docs: hierarchy schema contract (S2 contract 1, D2) #1435

Merged
fred merged 9 commits from contract/hierarchy-schema into next 2026-08-27 16:39:16 +00:00
9 Commits
Author SHA1 Message Date
fred e3b0375211 docs(hierarchy): revision 9 — complete the runner's importer enumeration (terra r8 F10)
ci/woodpecker/pr/ci Pipeline was successful
The 'one live importer' claim was false: the measured production importer
set of the db migration runner has four members (Gateway database module
via the barrel, storage Postgres adapter, fleet-backlog and gateway-verify
CLI commands via literal dynamic import). The enumeration example now
names all four, the import analysis resolves literal dynamic import()
routes, and a non-literal dynamic import of the db package fails the
assertion. Injection-only consumers (schema-check) have no import edge.
2026-08-26 19:31:09 -05:00
fred f07b4c73b1 docs: hierarchy schema revision 8 — re-export-aware import analysis, per-module importer enumeration (terra F9 residual)
ci/woodpecker/pr/ci Pipeline is pending
2026-08-26 19:18:11 -05:00
fred bf3bd6c477 docs: hierarchy schema revision 7 — infrastructure register for legitimate non-hierarchy raw execution (terra F9)
ci/woodpecker/pr/ci Pipeline was canceled
2026-08-26 19:09:00 -05:00
fred 5c1e8d290e docs: hierarchy contract revision 6 — three-prong wording, allowlist composition rules, honest detection scope (terra r5 F7/F8)
ci/woodpecker/pr/ci Pipeline is pending
2026-08-26 19:02:11 -05:00
fred e32d77e5a1 docs: hierarchy contract revision 5 — raw-execution prong closes dynamic-identifier evasion (terra r4 F7)
ci/woodpecker/pr/ci Pipeline is pending
2026-08-26 18:55:08 -05:00
fred dcf4220823 docs: hierarchy schema contract revision 4 (terra r3 residual F7: raw-SQL literal prong)
ci/woodpecker/pr/ci Pipeline is pending
2026-08-26 18:48:13 -05:00
fred f5e3165ea5 docs: hierarchy schema contract revision 3 (terra r2 residuals F4, F7)
ci/woodpecker/pr/ci Pipeline is pending
2026-08-26 18:43:00 -05:00
fred ee8c593858 docs: hierarchy schema contract revision 2 (terra review findings 1-9)
ci/woodpecker/pr/ci Pipeline was canceled
- tenancy-FK exemption: canonical workspace_id is the one permitted
  business->class reference; all other forms forbidden with control test
- record class = 4 node tables + hierarchy_grants per A1 8.1.2
- grant uniqueness via UNIQUE NULLS NOT DISTINCT (or 6 partial indexes);
  NOT NULL on role/granted_by/name/slug
- grant FK delete actions split: target cascade, principal RESTRICT
- audit parity: REQ-AUD-001 guarantees, same-transaction outbox,
  deletion-safe snapshot linkage, cascade coverage, rollback witness
- roll-up never-a-write restored to full A1 strength (no canonical writes)
- ownership invariant completed via contract 2; both-sides transfer rule
  marked new policy; legacy premise corrected
- corrected cardinality witness (one-parent-per-child + sibling control)
- provenance fixes: REQ-MIG-001 attribution dropped, projects table
  described accurately, D8-rank-1 claim removed
2026-08-26 18:29:53 -05:00
fred 7ef620cda7 docs: hierarchy schema contract (S2 contract 1, D2)
ci/woodpecker/pr/ci Pipeline was canceled
Turns PRD D2/D13 and kanban-SOT Amendment A1 into a concrete schema
contract: companies/estates/platform_projects/workspaces with NOT NULL
RESTRICT parent chains (chain uniqueness by construction), per-parent slug
scoping, hierarchy_grants attachment shape (vocabulary deferred to
contract 2), transfer as single audited parent-FK update requiring
both-sides authority, no owner columns (ownership = grants), fail-closed
bottom-up deletion, Gateway-only mutation path, and a verification matrix
with real-Postgres constraint witnesses.
2026-08-26 18:10:45 -05:00