IF Commons GitHub

Identity delegation

0039Active

0039-identity-delegation · owner if · domain data

Requirements

FR-001checkpassing

A delegation MUST say its tenant, who delegates and who is delegated to (never the same principal), the delegation above it and the first of its chain (both empty for the first), how deep it is, its purpose, the one resource it is limited to (exact or a prefix), an extra condition, whether it may be passed on and how many more times, when it starts, when it ends, its status and, where it was ended early, when, by whom and why; and MUST be kept a year after it ends.

Enforced (check): .github: cd commons/data && bun run verify — suite/identity.test.ts: on three engines an agent has an owner, versions that are pinned, tool grants, runs under delegations with the chain kept, budgets that are one per meter and window, calls that are one per index, and approvals bound to arguments

Proved by: data/suite/identity.test.ts

Written in: data/models/identity-delegation/mod.ts

Tests: passed: suite/identity.test.ts on three engines an agent has an owner, versions that are pinned, tool grants, runs under

FR-002checkpassing

A delegation MUST name the permissions it passes on, once each.

Enforced (check): .github: cd commons/data && bun run verify — suite/identity.test.ts: on three engines an agent has an owner, versions that are pinned, tool grants, runs under delegations with the chain kept, budgets that are one per meter and window, calls that are one per index, and approvals bound to arguments

Proved by: data/suite/identity.test.ts

Written in: data/models/identity-delegation/mod.ts

Tests: passed: suite/identity.test.ts on three engines an agent has an owner, versions that are pinned, tool grants, runs under

Out of scope

  • The operations that do the business of this module: a later specification, run by the operations runtime (0031).
  • How a decision is made from these tables: the decision engine is a later specification.

Edge cases

  • A kind of principal that has no table of its own in this module: it is held by the principal and its roles alone, per FR-001.
  • DuckDB loads this schema and can read it, and cannot update a row that another row refers to; operations that change principals, runs or delegations are for PostgreSQL and SQLite, per FR-001.

Assumptions

  • The application makes identifiers, hashes and timestamps; the database stores them and refuses what the constraints say.

Open questions

OQ-1open question

The constraints that governance cannot say (acyclic hierarchies, a subtype row only for a principal of its kind) are checks of the operations and of invariant queries, not of the schema.

Key entities

  • Delegation - what this module holds, as its requirements say.

Success criteria

SC-001success criterion

A project composes this module only when it needs it, and the database refuses what the requirements say it must refuse.

Review & acceptance checklist

  • [x] Every requirement is testable (MUST / MUST NOT), not aspirational
  • [x] No company fact is asserted here
  • [x] Every open item is marked, not silently decided

Cited by

Data, models/identity-delegation/mod

Titles, headings, exports, tables, columns and requirements. Esc closes.