Skip to content

Commit 457b062

Browse files
Merge pull request #36 from The-Interdependency/feat/stack-update-guard
feat: make structural stack updates fail closed
2 parents e3d05e5 + 8c9b79a commit 457b062

9 files changed

Lines changed: 662 additions & 20 deletions

File tree

.agents/skills/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Vendored agent skills
2+
3+
This directory contains repo-local consumed copies of canonical skills from
4+
`The-Interdependency/skill-lib`.
5+
6+
Installed subset:
7+
8+
- `stack-update` — source `The-Interdependency/skill-lib@a7b95f891d2e88c62e61524dc52a2e1577c9983d`, path `stack-update/SKILL.md`, source blob `a1e914893fa047e28d039050395937a1cf6e0138`.
9+
10+
Canonical doctrine remains in `skill-lib`; vendoring does not transfer authority.
11+
Structural stack changes must follow `.agents/skills/stack-update/SKILL.md` and pass
12+
`python tools/check_stack_consistency.py` before merge.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"schema": "the-interdependency.vendored-skill-provenance",
3+
"version": "1.0.0",
4+
"skill": "stack-update",
5+
"source_repository": "The-Interdependency/skill-lib",
6+
"source_commit": "a7b95f891d2e88c62e61524dc52a2e1577c9983d",
7+
"source_path": "stack-update/SKILL.md",
8+
"source_blob_sha": "a1e914893fa047e28d039050395937a1cf6e0138",
9+
"authority_transfer": false,
10+
"relation": "repo-local consumed copy; canonical doctrine remains in source repository"
11+
}
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
name: stack-update
3+
description: Fail-closed update protocol for The-Interdependency/stack. Load this when a stack change adds, moves, extracts, graduates, renames, removes, or changes the authority, relation, source identity, or placement of a participant, research workspace, libs pin, BASE record, stack manifest entry, or architecture description; when stack-manifest.json, STACK_MANIFEST.md, README.md, or research BASE.json files may drift from one another; or when validating that a structural stack change is complete before commit or merge.
4+
---
5+
6+
# stack-update — change the stack as one coherent transaction
7+
8+
Use this procedural skill for structural changes to `The-Interdependency/stack`.
9+
It specializes `interdependent-work-graph`; it does not replace that skill or
10+
`project-incubation-graduation`.
11+
12+
## Core contract
13+
14+
A stack change that alters **identity, ownership, authority, relation, lifecycle,
15+
or placement** is incomplete until every affected authority/provenance projection
16+
agrees and the deterministic stack-consistency checker passes.
17+
18+
```text
19+
structural mutation
20+
-> classify affected authority and relations
21+
-> update owning source and stack projections
22+
-> recompute machine identity
23+
-> validate local + cross-boundary consistency
24+
-> commit only when coherent
25+
```
26+
27+
Location never creates authority. A successful move, import, extraction, or test
28+
run does not itself update ownership, canon, proof status, measurement validity,
29+
or graduation standing.
30+
31+
## Trigger / non-trigger
32+
33+
Load this skill when a change touches any of these surfaces or their meaning:
34+
35+
- `libs/<repo>/` pins or imported canonical views;
36+
- `research/<workspace>/` creation, deletion, rename, extraction, or lifecycle;
37+
- `research/*/BASE.json` provenance or authority;
38+
- `stack-manifest.json` / `STACK_MANIFEST.md` participants, authorities, relations,
39+
boundaries, or work-graph digest;
40+
- root architecture descriptions in `README.md` or `AGENTS.md`;
41+
- an emergent project moving toward or away from independent-repository authority.
42+
43+
Do not load it for an ordinary implementation edit whose owning repository,
44+
workspace, authority, manifest identities, and architecture relations do not change.
45+
46+
## Required companion skills
47+
48+
1. Load `interdependent-work-graph` for every structural stack mutation.
49+
2. Load `project-incubation-graduation` when extraction, release, reconsumption,
50+
graduation, or implementation-authority transition is involved.
51+
3. Load `the-interdependency` for organization workflow and GitHub hygiene.
52+
4. Consult current METAPAT only when the change requires choosing a new conceptual
53+
distinction or authority relation rather than implementing an already-fixed one.
54+
55+
## Workflow
56+
57+
1. **Freeze the starting identity.** Record the exact stack commit and every
58+
producer/source commit whose authority can affect the change.
59+
2. **Classify the mutation.** Mark each affected item as one or more of:
60+
`identity`, `authority`, `relation`, `placement`, `lifecycle`, `pin`, `projection`.
61+
3. **Resolve edit ownership.** Change a claim at its owning source. Never repair a
62+
producer-owned defect by shadowing it in a consumer or by editing `libs/`.
63+
4. **Compute the update closure.** Inspect at minimum:
64+
`stack-manifest.json`, `STACK_MANIFEST.md`, root `README.md`, root `AGENTS.md`,
65+
the affected `research/*/BASE.json`, relevant local README/docs, and CI/checkers.
66+
Update every projection whose statement became false because of the mutation.
67+
5. **Remove superseded claims.** A newly separated owner requires the prior owner to
68+
stop claiming that responsibility in every stack-level authority projection.
69+
Do not merely add the new owner alongside stale text.
70+
6. **Preserve lifecycle standing.** Extraction is not graduation. Stack-local work
71+
remains noncanonical until its governing graduation gates complete and stack
72+
reconsumes the released independent artifact where required.
73+
7. **Recompute machine identity.** Recompute `work_graph_sha256` exactly from the
74+
versioned manifest contract after any hashed field changes. Never hand-wave or
75+
copy an old digest.
76+
8. **Run deterministic consistency validation.** In stack, run:
77+
78+
```bash
79+
python tools/check_stack_consistency.py
80+
```
81+
82+
Treat any error as a blocked structural update, not a documentation warning.
83+
9. **Run affected behavioral gates.** Execute repository/workspace-local tests and
84+
at least one cross-boundary check for changed producer/consumer relations.
85+
10. **Commit the transaction.** The structural mutation and its required projections
86+
belong in one coherent PR/merge sequence. If a necessary authority is unavailable,
87+
preserve the boundary as `hmmm`; do not guess it into consistency.
88+
89+
## Deterministic checker contract
90+
91+
A consuming stack checker should fail closed for at least:
92+
93+
- a `work_graph_sha256` that does not reproduce from the declared manifest fields;
94+
- disagreement between machine-readable and human-readable repository authority;
95+
- direct tracked edits to `libs/` presented as stack-owned canon;
96+
- an affected `BASE.json` whose source repository/commit conflicts with the pinned
97+
source identity it claims to derive from;
98+
- an emergent stack-local component whose authority separation is declared locally
99+
while stack-level authority text still assigns that responsibility to its former owner;
100+
- lifecycle language that treats extraction as graduation;
101+
- a structural update that changes one required projection but omits another.
102+
103+
The checker validates coherence, not truth of scientific or semantic claims. Those
104+
remain owned by their proper repositories and evidence.
105+
106+
## Output shape
107+
108+
When this skill is active, report:
109+
110+
```markdown
111+
## Stack transaction
112+
- start identity:
113+
- mutation class:
114+
- affected authority / relations:
115+
- files changed:
116+
117+
## Validation
118+
- stack consistency:
119+
- local gates:
120+
- cross-boundary gate:
121+
122+
## Standing
123+
- canon / research / extracted / graduated:
124+
- hmmm:
125+
```
126+
127+
## Usage guidance
128+
129+
Before moving or separating a stack component, run the checker once **before** the
130+
change to establish the current baseline, make the structural edit and all required
131+
projection updates, then run it again. A pre-existing failure is evidence to classify;
132+
it is not permission to add another inconsistency.
133+
134+
Example: moving English Gonol Construction out of EDCM requires the new workspace and
135+
its provenance **and** removal of `text-gonol construction` from EDCM's stack-level
136+
authority statement, corresponding manifest/work-graph updates, digest regeneration,
137+
and the affected English Gonol + EDCM checks.
138+
139+
## Anti-patterns
140+
141+
- Moving code first and treating manifest/docs repair as optional cleanup.
142+
- Updating `stack-manifest.json` but not `STACK_MANIFEST.md`, or vice versa.
143+
- Adding a new authority statement without removing the superseded one.
144+
- Editing `libs/<repo>/` to make a stack-local inconsistency disappear.
145+
- Reusing a stale work-graph digest after changing hashed fields.
146+
- Calling an extracted project graduated because the new repository exists.
147+
- Making CI green by widening `PYTHONPATH` or weakening checks instead of repairing
148+
ownership/provenance drift.
149+
150+
## hmmm
151+
152+
- The first stack checker is intentionally conservative: it can prove declared
153+
projections agree, but it cannot infer every semantic responsibility from source code.
154+
- Future schema revisions may carry explicit typed stack-local component records and
155+
edge lists so more structural obligations can be checked without text comparisons.
156+
- A checklist that never fails a build eventually becomes wall decoration.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: stack-consistency
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'stack-manifest.json'
7+
- 'STACK_MANIFEST.md'
8+
- 'README.md'
9+
- 'AGENTS.md'
10+
- 'research/**'
11+
- 'libs/**'
12+
- 'tools/check_stack_consistency.py'
13+
- '.agents/skills/stack-update/**'
14+
- '.github/workflows/stack-consistency.yml'
15+
push:
16+
branches: [main]
17+
paths:
18+
- 'stack-manifest.json'
19+
- 'STACK_MANIFEST.md'
20+
- 'README.md'
21+
- 'AGENTS.md'
22+
- 'research/**'
23+
- 'libs/**'
24+
- 'tools/check_stack_consistency.py'
25+
- '.agents/skills/stack-update/**'
26+
- '.github/workflows/stack-consistency.yml'
27+
28+
permissions:
29+
contents: read
30+
31+
jobs:
32+
consistency:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
- name: Verify stack authority and provenance projections
37+
run: python tools/check_stack_consistency.py

AGENTS.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ projects may later graduate into their own repositories.
1010
inside stack; canonical edits happen in the owning repository.
1111
- `research/<repo>/` is current stack-local research against an exact pinned base. It is
1212
not canon merely because it is in stack.
13+
- `research/english-gonol/` is a distinct stack-local English lexical/gonol construction
14+
component. UCNS owns consumed geometry; EDCM may evaluate outputs but does not define
15+
the English Gonol construction.
1316
- root-level emerging projects such as `ahbg/` may be close to external repo-hood; root
1417
placement does not transfer authority from their inputs.
1518
- `STACK_MANIFEST.md` and `stack-manifest.json` own stack-level participant provenance.
@@ -18,6 +21,27 @@ projects may later graduate into their own repositories.
1821
- `skill-lib/` is the currently pinned operational skill snapshot; exact newer doctrine
1922
may be bound separately only when its provenance and non-transfer boundary are explicit.
2023

24+
## Structural update gate
25+
26+
Before adding, moving, separating, extracting, graduating, renaming, removing, or
27+
changing the authority/relation/pin of a stack participant or research workspace, load:
28+
29+
```text
30+
.agents/skills/stack-update/SKILL.md
31+
```
32+
33+
Also resolve the applicable `interdependent-work-graph` doctrine and, for lifecycle
34+
transitions, `project-incubation-graduation`. Structural changes are one transaction:
35+
update every affected machine/human authority projection, remove superseded ownership
36+
claims, recompute the work-graph digest, and pass:
37+
38+
```bash
39+
python tools/check_stack_consistency.py
40+
```
41+
42+
Do not treat moved code, passing local tests, or a new repository as sufficient evidence
43+
that stack authority/provenance records are current.
44+
2145
## Fresh-making boundary
2246

2347
PostgreSQL on the VM is the single production state authority for derivation specs,
@@ -50,6 +74,12 @@ namespace is deprecated and removed; use `stackctl fresh ...`.
5074

5175
## Checks
5276

77+
Structural stack consistency:
78+
79+
```bash
80+
python tools/check_stack_consistency.py
81+
```
82+
5383
Fresh-making/backend checks that can run without PostgreSQL:
5484

5585
```bash
@@ -65,13 +95,16 @@ PostgreSQL integration checks require an explicitly disposable database. A skipp
6595
integration check is `hmmm`, not a pass.
6696

6797
AHBG/Grok has its own local suites under `ahbg/grok/`; run those when touching that
68-
workspace. Do not claim root manifest-check tooling that is not present in this branch.
98+
workspace. The root stack-consistency checker verifies declared authority/provenance
99+
coherence; it does not replace workspace behavioral tests.
69100

70101
## hmmm
71102

72103
- Concrete VM PostgreSQL/auth/service-account/storage and backup-mount acceptance remains
73104
unobserved until checked on the VM.
74105
- Organization aggregate and website-projection derivation specs are not yet registered.
106+
- English Gonol Construction has distinct stack-local authority but has not yet gained an
107+
independent repository/release authority boundary.
75108
- The complete root `skill-lib/` snapshot refresh remains separate because the current
76109
provenance-bound fresh-making doctrine is newer than the local generator snapshot.
77110
- Project graduation automation remains unimplemented.

README.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ For repositories with an independent authority:
2020
```text
2121
stack/
2222
├── skill-lib/ # operational pinned snapshot of org build/evidence doctrine
23+
├── .agents/skills/ # repo-local consumed skills; stack-update guards structural changes
2324
├── libs/ # manifest-pinned canonical repository views; do not edit
2425
│ ├── metapat/
2526
│ ├── ucns/
@@ -31,7 +32,8 @@ stack/
3132
├── research/ # stack-local work; never source authority by location
3233
│ ├── metapat/ # current METAPAT research + BASE.json
3334
│ ├── ucns/ # current UCNS research + BASE.json
34-
│ ├── edcm/ # current EDCM research + BASE.json
35+
│ ├── english-gonol/ # English lexical/gonol construction; distinct from EDCM
36+
│ ├── edcm/ # current EDCM measurement research + BASE.json
3537
│ ├── pcea/ # current PCEA research + BASE.json
3638
│ ├── ptcna/ # current PTCNA research + BASE.json
3739
│ ├── epac/ # extracted candidate remains forge-side until graduation completes
@@ -41,6 +43,8 @@ stack/
4143
├── backend/ # PostgreSQL-backed durable fresh-making control plane
4244
├── frontend/
4345
│ └── cli/ # human control/status surface for backend
46+
├── tools/
47+
│ └── check_stack_consistency.py # deterministic authority/provenance drift gate
4448
├── STACK_MANIFEST.md # human-readable provenance and boundary record
4549
└── stack-manifest.json # machine-readable work graph
4650
```
@@ -68,6 +72,27 @@ cat research/ucns/BASE.json
6872
If the result changes UCNS itself, prepare the change for `The-Interdependency/ucns`.
6973
After upstream merge, refresh `libs/ucns/` and update `research/ucns/BASE.json`.
7074

75+
English Gonol Construction is a separated stack-local component at
76+
`research/english-gonol/`. UCNS owns its consumed geometry. English Gonol owns the
77+
English text-domain construction candidate. EDCM may evaluate those outputs but does
78+
not define the construction.
79+
80+
### Change stack structure
81+
82+
Any change that alters a participant, pin, authority, relation, research workspace,
83+
extraction/graduation standing, `BASE.json`, or architecture projection must load the
84+
`stack-update` skill and finish as one coherent stack transaction.
85+
86+
Run the deterministic gate before and after the mutation:
87+
88+
```bash
89+
python tools/check_stack_consistency.py
90+
```
91+
92+
A structural change is not complete merely because moved code or local tests pass. The
93+
machine manifest, human manifest, affected base records, architecture description, and
94+
work-graph digest must agree before merge.
95+
7196
### Compose something new
7297

7398
New cross-project work may be born in stack. It does not inherit the authority of its
@@ -76,11 +101,13 @@ coherent enough to graduate, create its independent repository, preserve provena
76101
package/release it, then let stack consume the released project rather than a hidden
77102
stack-local implementation.
78103

79-
EPAC and psychsocio metafauna are currently in this pre-graduation state. EPAC
80-
has an independent extracted repository, but extraction is not graduation: its
81-
forge research remains here until EPAC completes its release, downstream
82-
reconsumption, and authority-transition gates. From Photons to the Macroverse is
83-
also stack-local pre-graduation research.
104+
English Gonol Construction is currently a distinct stack-local research component,
105+
separated from EDCM but not independently graduated.
106+
EPAC and psychsocio metafauna are currently in this pre-graduation state.
107+
EPAC is further along: it has an independent extracted repository, but extraction is not
108+
graduation, so its forge research remains here until EPAC completes its release,
109+
downstream reconsumption, and authority-transition gates. From Photons to the Macroverse
110+
is also stack-local pre-graduation research.
84111

85112
### Make derived artifacts fresh without depending on hosted CI
86113

@@ -122,7 +149,8 @@ git -C <checkout> archive <commit> | tar -x -C libs/<name>/
122149

123150
Then update `STACK_MANIFEST.md`, `stack-manifest.json`, and the matching
124151
`research/<name>/BASE.json`; recompute the work-graph digest; and commit with the exact
125-
source commit in the message.
152+
source commit in the message. Run `python tools/check_stack_consistency.py` before
153+
merge.
126154

127155
## Boundaries
128156

@@ -132,7 +160,7 @@ source commit in the message.
132160
populated only from an owning canonical repository at an exact commit.
133161
- proof, measurement, semantic, empirical, and certification standing do not transfer
134162
merely because projects are composed in stack.
135-
- `backend/` may coordinate an owning repository but does not acquire that repository's
163+
- backend may coordinate an owning repository but does not acquire that repository's
136164
authority.
137165
- PostgreSQL owns orchestration/freshness evidence, not repository artifacts or canon.
138166
- executor success alone cannot establish freshness; the declared verifier and accepted
@@ -147,6 +175,8 @@ source commit in the message.
147175
`libs/` + `research/` pair.
148176
- The exact graduation automation from stack-local project to independent repo + package
149177
is not yet implemented.
178+
- English Gonol Construction has distinct stack-local authority but has not yet gained an
179+
independent repository/release authority boundary.
150180
- Actual VM PostgreSQL/service-account/storage state and the independent backup device
151181
remain deployment observations until inspected on the VM.
152182
- A GitHub-hosted executor remains optional and unimplemented; VM-local execution is the

0 commit comments

Comments
 (0)