@tiphys/kernel 0.0.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/AGENTS.md +663 -0
  2. package/LICENSE +202 -0
  3. package/assurance-modes.yaml +299 -0
  4. package/checklists/clean-room.yaml +325 -0
  5. package/checklists/env-failure-diagnosis.yaml +68 -0
  6. package/checklists/flake-playbook.yaml +68 -0
  7. package/checklists/hazard-review.yaml +144 -0
  8. package/checklists/plan-review.yaml +103 -0
  9. package/dist/bin/tiphys.d.ts +2 -0
  10. package/dist/bin/tiphys.js +92 -0
  11. package/dist/src/adapters/load.d.ts +202 -0
  12. package/dist/src/adapters/load.js +440 -0
  13. package/dist/src/brief.d.ts +32 -0
  14. package/dist/src/brief.js +66 -0
  15. package/dist/src/checklists.d.ts +169 -0
  16. package/dist/src/checklists.js +310 -0
  17. package/dist/src/checks.d.ts +1539 -0
  18. package/dist/src/checks.js +5025 -0
  19. package/dist/src/cli.d.ts +9 -0
  20. package/dist/src/cli.js +68 -0
  21. package/dist/src/commands/brief.d.ts +92 -0
  22. package/dist/src/commands/brief.js +343 -0
  23. package/dist/src/commands/checklist.d.ts +42 -0
  24. package/dist/src/commands/checklist.js +168 -0
  25. package/dist/src/commands/cutover.d.ts +35 -0
  26. package/dist/src/commands/cutover.js +448 -0
  27. package/dist/src/commands/doctor.d.ts +264 -0
  28. package/dist/src/commands/doctor.js +1546 -0
  29. package/dist/src/commands/gates.d.ts +9 -0
  30. package/dist/src/commands/gates.js +360 -0
  31. package/dist/src/commands/init.d.ts +30 -0
  32. package/dist/src/commands/init.js +177 -0
  33. package/dist/src/commands/lock.d.ts +34 -0
  34. package/dist/src/commands/lock.js +340 -0
  35. package/dist/src/commands/mode.d.ts +40 -0
  36. package/dist/src/commands/mode.js +134 -0
  37. package/dist/src/commands/next.d.ts +130 -0
  38. package/dist/src/commands/next.js +597 -0
  39. package/dist/src/commands/plan.d.ts +20 -0
  40. package/dist/src/commands/plan.js +105 -0
  41. package/dist/src/commands/pool.d.ts +1 -0
  42. package/dist/src/commands/pool.js +139 -0
  43. package/dist/src/commands/resume.d.ts +1 -0
  44. package/dist/src/commands/resume.js +88 -0
  45. package/dist/src/commands/spawn.d.ts +1 -0
  46. package/dist/src/commands/spawn.js +195 -0
  47. package/dist/src/commands/status.d.ts +21 -0
  48. package/dist/src/commands/status.js +122 -0
  49. package/dist/src/commands/sync.d.ts +47 -0
  50. package/dist/src/commands/sync.js +341 -0
  51. package/dist/src/commands/teardown.d.ts +1 -0
  52. package/dist/src/commands/teardown.js +87 -0
  53. package/dist/src/commands/tuition.d.ts +21 -0
  54. package/dist/src/commands/tuition.js +218 -0
  55. package/dist/src/commands/validate.d.ts +78 -0
  56. package/dist/src/commands/validate.js +430 -0
  57. package/dist/src/commands/watch.d.ts +1 -0
  58. package/dist/src/commands/watch.js +172 -0
  59. package/dist/src/cutover.d.ts +584 -0
  60. package/dist/src/cutover.js +1444 -0
  61. package/dist/src/exclusion.d.ts +389 -0
  62. package/dist/src/exclusion.js +843 -0
  63. package/dist/src/exec/env.d.ts +278 -0
  64. package/dist/src/exec/env.js +334 -0
  65. package/dist/src/fleet.d.ts +223 -0
  66. package/dist/src/fleet.js +298 -0
  67. package/dist/src/gates/adapters/http-json.d.ts +5 -0
  68. package/dist/src/gates/adapters/http-json.js +283 -0
  69. package/dist/src/gates/adapters/migrations-command.d.ts +1 -0
  70. package/dist/src/gates/adapters/migrations-command.js +373 -0
  71. package/dist/src/gates/citations.d.ts +408 -0
  72. package/dist/src/gates/citations.js +1169 -0
  73. package/dist/src/gates/coverage.d.ts +375 -0
  74. package/dist/src/gates/coverage.js +836 -0
  75. package/dist/src/gates/credentials.d.ts +233 -0
  76. package/dist/src/gates/credentials.js +752 -0
  77. package/dist/src/gates/deploy.d.ts +1 -0
  78. package/dist/src/gates/deploy.js +33 -0
  79. package/dist/src/gates/gate-classes.d.ts +56 -0
  80. package/dist/src/gates/gate-classes.js +633 -0
  81. package/dist/src/gates/manifest.d.ts +99 -0
  82. package/dist/src/gates/manifest.js +208 -0
  83. package/dist/src/gates/merge-preconditions.d.ts +319 -0
  84. package/dist/src/gates/merge-preconditions.js +932 -0
  85. package/dist/src/gates/migrations.d.ts +1 -0
  86. package/dist/src/gates/migrations.js +36 -0
  87. package/dist/src/gates/pin.d.ts +114 -0
  88. package/dist/src/gates/pin.js +154 -0
  89. package/dist/src/gates/red-witness.d.ts +22 -0
  90. package/dist/src/gates/red-witness.js +482 -0
  91. package/dist/src/gates/release.d.ts +283 -0
  92. package/dist/src/gates/release.js +820 -0
  93. package/dist/src/gates/result.d.ts +116 -0
  94. package/dist/src/gates/result.js +91 -0
  95. package/dist/src/gates/run.d.ts +614 -0
  96. package/dist/src/gates/run.js +1614 -0
  97. package/dist/src/gates/schemas/citation-config.schema.json +59 -0
  98. package/dist/src/gates/schemas/coverage-config.schema.json +77 -0
  99. package/dist/src/gates/schemas/gate-manifest.schema.json +125 -0
  100. package/dist/src/gates/schemas/gate-result.schema.json +160 -0
  101. package/dist/src/gates/schemas/phase-declaration.schema.json +87 -0
  102. package/dist/src/gates/schemas/release-record.schema.json +119 -0
  103. package/dist/src/gates/schemas/verifier-config.schema.json +101 -0
  104. package/dist/src/gates/schemas/witness-spec.schema.json +110 -0
  105. package/dist/src/gates/scope.d.ts +131 -0
  106. package/dist/src/gates/scope.js +1018 -0
  107. package/dist/src/gates/suite.d.ts +217 -0
  108. package/dist/src/gates/suite.js +968 -0
  109. package/dist/src/gates/validate.d.ts +121 -0
  110. package/dist/src/gates/validate.js +414 -0
  111. package/dist/src/hooks.d.ts +84 -0
  112. package/dist/src/hooks.js +125 -0
  113. package/dist/src/index.d.ts +31 -0
  114. package/dist/src/index.js +30 -0
  115. package/dist/src/liveness.d.ts +321 -0
  116. package/dist/src/liveness.js +396 -0
  117. package/dist/src/lock.d.ts +256 -0
  118. package/dist/src/lock.js +792 -0
  119. package/dist/src/model-resolution.d.ts +159 -0
  120. package/dist/src/model-resolution.js +307 -0
  121. package/dist/src/modes.d.ts +149 -0
  122. package/dist/src/modes.js +258 -0
  123. package/dist/src/path-identity.d.ts +34 -0
  124. package/dist/src/path-identity.js +48 -0
  125. package/dist/src/plan.d.ts +73 -0
  126. package/dist/src/plan.js +153 -0
  127. package/dist/src/pool.d.ts +326 -0
  128. package/dist/src/pool.js +988 -0
  129. package/dist/src/roles.d.ts +461 -0
  130. package/dist/src/roles.js +776 -0
  131. package/dist/src/spawn.d.ts +482 -0
  132. package/dist/src/spawn.js +1003 -0
  133. package/dist/src/status.d.ts +116 -0
  134. package/dist/src/status.js +148 -0
  135. package/dist/src/task.d.ts +504 -0
  136. package/dist/src/task.js +307 -0
  137. package/dist/src/teardown.d.ts +39 -0
  138. package/dist/src/teardown.js +422 -0
  139. package/dist/src/tuition.d.ts +159 -0
  140. package/dist/src/tuition.js +311 -0
  141. package/dist/src/validate.d.ts +263 -0
  142. package/dist/src/validate.js +742 -0
  143. package/dist/src/version.d.ts +3 -0
  144. package/dist/src/version.js +38 -0
  145. package/dist/src/watcher.d.ts +275 -0
  146. package/dist/src/watcher.js +849 -0
  147. package/dist/src/witness/run.d.ts +299 -0
  148. package/dist/src/witness/run.js +1373 -0
  149. package/dist/src/witness/spec.d.ts +270 -0
  150. package/dist/src/witness/spec.js +475 -0
  151. package/dist/tsconfig.src.tsbuildinfo +1 -0
  152. package/gate-registry.yaml +526 -0
  153. package/gates.manifest.json +257 -0
  154. package/package.json +72 -3
  155. package/role-model-config.yaml +88 -0
  156. package/roles/README.md +128 -0
  157. package/roles/_shared-dispatch-contract.md +87 -0
  158. package/roles/adversarial-plan-reviewer.md +80 -0
  159. package/roles/clean-room-reviewer.md +140 -0
  160. package/roles/implementer.md +463 -0
  161. package/roles/investigator.md +138 -0
  162. package/roles/plan-writer.md +95 -0
  163. package/schemas/README.md +82 -0
  164. package/schemas/assurance-modes.schema.json +264 -0
  165. package/schemas/charter.schema.json +185 -0
  166. package/schemas/checklist.schema.json +114 -0
  167. package/schemas/cutover-state.schema.json +64 -0
  168. package/schemas/decision-record.schema.json +88 -0
  169. package/schemas/executor-record.schema.json +36 -0
  170. package/schemas/final-report.schema.json +90 -0
  171. package/schemas/finding.schema.json +106 -0
  172. package/schemas/gate-registry.schema.json +260 -0
  173. package/schemas/mechanism-index.schema.json +94 -0
  174. package/schemas/model-resolution.schema.json +362 -0
  175. package/schemas/plan.schema.json +300 -0
  176. package/schemas/report.schema.json +579 -0
  177. package/schemas/role-brief.schema.json +105 -0
  178. package/schemas/role-model-config.schema.json +90 -0
  179. package/schemas/status-line.schema.json +40 -0
  180. package/schemas/tuition.schema.json +191 -0
  181. package/schemas/verdict.schema.json +295 -0
  182. package/schemas/work-history.schema.json +183 -0
  183. package/schemas/write-bypass.schema.json +69 -0
  184. package/templates/charter.example.yaml +54 -0
  185. package/templates/decision-record.example.yaml +27 -0
  186. package/templates/final-report.example.yaml +80 -0
  187. package/templates/plan.example.yaml +87 -0
  188. package/templates/report.example.yaml +236 -0
  189. package/templates/warnings.md +74 -0
  190. package/templates/work-history.example.yaml +185 -0
  191. package/tuition/README.md +76 -0
  192. package/tuition/T-001.yaml +48 -0
  193. package/tuition/T-002.yaml +51 -0
  194. package/tuition/T-003.yaml +100 -0
  195. package/tuition/T-004.yaml +52 -0
  196. package/tuition/T-005.yaml +72 -0
  197. package/tuition/T-006.yaml +81 -0
  198. package/tuition/T-007.yaml +56 -0
  199. package/tuition/T-008.yaml +111 -0
  200. package/tuition/T-009.yaml +50 -0
  201. package/tuition/T-015.yaml +36 -0
  202. package/tuition/T-016.yaml +36 -0
  203. package/tuition/T-017.yaml +46 -0
  204. package/tuition/T-018.yaml +84 -0
  205. package/tuition/T-021.yaml +40 -0
  206. package/tuition/T-022.yaml +36 -0
  207. package/tuition/mechanism-index.yaml +256 -0
@@ -0,0 +1,56 @@
1
+ # T-007: a phase met fifteen of fifteen executed acceptance criteria and still
2
+ # live-locked every supervision command. Promoted by M3-P8.
3
+ kind: tuition
4
+ version: 1
5
+ id: T-007
6
+ project: tiphys-kernel
7
+ date: 2026-08-05
8
+ stage: M1-P5 (watcher and liveness guard), third dual review
9
+ kernel-relevant: true
10
+ what-happened: >-
11
+ Every one of a phase's fifteen acceptance criteria was walked and met, and the
12
+ delivered component still blocked forever on a named pipe at a path it read,
13
+ taking every supervision command with it. Two reviews ran on one head: the
14
+ criteria walk approved, and the hazard-framed review, given the question "what
15
+ can block, what can be lost, what can never exit", found the defect. The two
16
+ agreed on every mechanical fact; they disagreed on the verdict because they
17
+ were asking different questions.
18
+ lesson:
19
+ - >-
20
+ Acceptance criteria inherit the blind spots of whoever wrote them, so a
21
+ criteria walk cannot find a defect the criteria could not express. "All
22
+ criteria met" is one input, never a terminal green.
23
+ - >-
24
+ A code phase needs two review CONTRACTS, not two reviewers, and the second
25
+ one must be a declared artifact rather than something the dispatch prompt
26
+ is trusted to remember.
27
+ - >-
28
+ The hazard question is derivable from the component's nature, which means
29
+ it belongs in the plan rather than in a prompt.
30
+ structural-consequence:
31
+ - target: schemas/plan.schema.json
32
+ status: applied
33
+ change: >-
34
+ A phase declares its hazard-classes[] beside its acceptance criteria, so
35
+ the second review contract is derived from the plan rather than improvised
36
+ per dispatch.
37
+ - target: assurance-modes.yaml
38
+ status: applied
39
+ change: >-
40
+ review-contracts[] are declared per mode, so a mode says how many
41
+ contracts a review round carries and what each one asks.
42
+ - target: roles/clean-room-reviewer.md
43
+ status: applied
44
+ change: >-
45
+ The brief carries a review-contract field, so a reviewer knows which
46
+ contract it is executing and a hazard contract cannot be silently
47
+ dropped.
48
+ - target: checklists/hazard-review.yaml
49
+ status: ticketed
50
+ change: >-
51
+ The hazard contract gets its own checklist, so the second contract has
52
+ probes rather than only a framing.
53
+ record: delivery/plan/kernel-plan-m3.md, M3-P7
54
+ evidence:
55
+ - delivery/review/clean-room-m1-p5-third-hazard.md and delivery/review/clean-room-m1-p5-third-criteria.md, the two verdicts on one head
56
+ - delivery/review/arbitration-m1-p5-third-round.md, the arbitration
@@ -0,0 +1,111 @@
1
+ # T-008: the orchestrator supervised two agents with no beacon and no guard,
2
+ # and lost nine hours. Promoted by M3-P8.
3
+ kind: tuition
4
+ version: 1
5
+ id: T-008
6
+ project: tiphys-kernel
7
+ date: 2026-08-06
8
+ stage: M1-P6, fifth review pass
9
+ kernel-relevant: true
10
+ what-happened: >-
11
+ Two review agents died within minutes of dispatch and the orchestrator did not
12
+ notice for nine hours and eleven minutes, while answering the owner and
13
+ dispatching other work throughout. Its supervision was "wait for a completion
14
+ notification", which is process liveness: a dead process sends no
15
+ notification, and no notification is indistinguishable from work in progress.
16
+ The first watchdog written after the incident then tested whether the report
17
+ file EXISTED, so it fired two minutes in, reported success, and said nothing.
18
+ lesson:
19
+ - >-
20
+ Supervision is a freshness watchdog armed in the same turn as the
21
+ dispatch, never a wait for a completion notification.
22
+ - >-
23
+ Every dispatched agent writes its output incrementally, so its artifact's
24
+ mtime is a beacon and a death leaves a salvageable partial result.
25
+ - >-
26
+ A guard whose condition does not test the property that matters is green
27
+ and worthless, which is the red-witness rule one level up.
28
+ mechanisms:
29
+ - mechanism: Supervising a dispatched agent
30
+ rule: >-
31
+ Supervision is a FRESHNESS watchdog armed in the same turn as the
32
+ dispatch, never a wait for a completion notification and never a probe of
33
+ process liveness (constraint C-2). The watchdog must test freshness, never
34
+ existence and never completion, must watch the union of the paths the
35
+ agent actually writes (measured, not predicted), and must exclude the
36
+ supervisor's own trees, because a watchdog that cannot go red is worse
37
+ than none.
38
+ siblings:
39
+ - src/watcher.ts
40
+ - src/liveness.ts
41
+ evidence:
42
+ - delivery/tuition/T-008-the-orchestrator-had-no-beacon.md, nine hours and eleven minutes measured
43
+ - delivery/tuition/T-014-the-watchdog-watched-the-wrong-place-six-times.md, six wrong applications of the same rule in one session
44
+ - mechanism: Parsing another program's reporter output
45
+ rule: >-
46
+ PIN the format as a controlled input rather than widening the parse. A
47
+ format-agnostic regex is a union of formats known on the day, and the
48
+ default already differs between the two toolchains this project runs.
49
+ siblings:
50
+ - src/gates/suite.ts
51
+ evidence:
52
+ - M1-P6 floor defect
53
+ - "`NODE_OPTIONS=--test-reporter=tap` scoped to the child"
54
+ - mechanism: Deciding what another program will do by pattern-matching the text of a file it consumes
55
+ rule: >-
56
+ A regex over a file and the consuming program's evaluation of that file
57
+ are DIFFERENT FUNCTIONS, so every finding is another input where they
58
+ differ, and rounds close instances forever. Three tiers instead, each
59
+ labelled by what enforces it: execute the extractable part against stubs;
60
+ PIN the accepted shapes and fail closed on anything else, never widen the
61
+ pattern; and where a denylist is unavoidable, DERIVE it by walking the
62
+ consuming program's closed documented vocabulary once, publishing the
63
+ walk. Name what remains unguarded rather than chasing it.
64
+ siblings:
65
+ - test/exit-test-local.test.ts
66
+ - test/m2-exit-test.test.ts
67
+ evidence:
68
+ - Four M1-P6 rounds, CR-640, CR-661, CR-681, CR-720 to CR-725
69
+ - the derived walk found two members no reviewer had named (`working-directory`, a custom `shell` template)
70
+ - "the widen-the-regex approach produced a guard that both missed real defangs and rejected `needs: [test, lint]`, an edit that STRENGTHENS the guarded property"
71
+ - mechanism: Asserting a CI step is wired
72
+ rule: >-
73
+ Assert BEHAVIOUR, not text. A text assertion catches deletion and misses
74
+ defanging. Extract the step and execute it against stubs. A witness for a
75
+ class must redden under at least two structurally different members.
76
+ siblings:
77
+ - test/exit-test-local.test.ts
78
+ - test/m2-exit-test.test.ts
79
+ - test/implementer-brief.test.ts
80
+ evidence:
81
+ - CR-640, CR-661, CR-681
82
+ - delivery/verification/cr-661-orchestrator-reproduction.md
83
+ - mechanism: A guard's own failure path
84
+ rule: >-
85
+ A guard whose correctness depends on a crash is not a guard. Make the
86
+ success path total, so removing the explicit failure is visible.
87
+ siblings:
88
+ - test/exit-test-local.test.ts
89
+ evidence:
90
+ - M1-P6 fix round 2, the D3 defang the implementer caught in its own fix
91
+ structural-consequence:
92
+ - target: roles/implementer.md
93
+ status: applied
94
+ change: >-
95
+ The incremental-output and beacon-is-not-a-claim clauses make the beacon
96
+ an obligation of the dispatched agent and forbid reading its existence as
97
+ progress.
98
+ - target: roles/clean-room-reviewer.md
99
+ status: applied
100
+ change: >-
101
+ The same two clauses bind review agents, which is the half of the dispatch
102
+ contract this incident actually needed.
103
+ - target: AGENTS.md
104
+ status: ticketed
105
+ change: >-
106
+ The orchestrator's supervision section states the watchdog rule and the
107
+ three questions a dispatch turn answers in writing before arming one.
108
+ record: delivery/plan/kernel-plan-m3.md, M3-P9
109
+ evidence:
110
+ - delivery/tuition/T-008-the-orchestrator-had-no-beacon.md, the measured nine hours and eleven minutes
111
+ - delivery/work-history/m1-p6.md, the phase running while the two agents were dead
@@ -0,0 +1,50 @@
1
+ # T-009: main was red for four hours and twenty-one minutes while every pull
2
+ # request check was green. Promoted by M3-P8.
3
+ kind: tuition
4
+ version: 1
5
+ id: T-009
6
+ project: tiphys-kernel
7
+ date: 2026-08-07
8
+ stage: M2 tail
9
+ kernel-relevant: true
10
+ what-happened: >-
11
+ The CI workflow fires on two events and they run different bundles: the pull
12
+ request event runs the strong bundle with a phase id derived from the head
13
+ ref, and a push to the default branch runs a main bundle with no phase. A
14
+ defect on the arm only one event takes was invisible to the other, so the
15
+ default branch stayed red across five consecutive push runs while every pull
16
+ request check was green, and four more merges landed on it. The owner
17
+ surfaced it, not the process.
18
+ lesson:
19
+ - >-
20
+ A gate result is evidence only for the configuration it ran under. "CI is
21
+ green" is never a complete sentence: the complete sentence names the event
22
+ and the head sha.
23
+ - >-
24
+ A merge is not complete until the post-merge run on the new head is
25
+ observed to completion. Not the check on the branch: the run whose head
26
+ sha is the new tip.
27
+ - >-
28
+ Where behaviour forks on the CI event, BOTH arms need a witness. One
29
+ witnessed arm and one unwitnessed arm is the exact shape that broke here,
30
+ and the unwitnessed one is the one that broke.
31
+ structural-consequence:
32
+ - target: schemas/report.schema.json
33
+ status: applied
34
+ change: >-
35
+ A reported gate result carries the event and the head it ran under, so a
36
+ green cannot be quoted outside the configuration that produced it.
37
+ - target: gate-registry.yaml
38
+ status: applied
39
+ change: >-
40
+ Every gate declares the CI events it runs on, so the two arms are data a
41
+ reader can compare rather than a property of a workflow file.
42
+ - target: AGENTS.md
43
+ status: ticketed
44
+ change: >-
45
+ The orchestrator's merge duty includes observing the post-merge run on the
46
+ new head before the phase is closed.
47
+ record: delivery/plan/kernel-plan-m3.md, M3-P9
48
+ evidence:
49
+ - delivery/tuition/T-009-green-on-the-wrong-event.md, the five red push runs and the four merges
50
+ - delivery/work-history/m2-p9.md, the exit-test harness the incident ran through
@@ -0,0 +1,36 @@
1
+ # T-015: a citation into a newest-at-top file rots on every append. Promoted
2
+ # by M3-P8.
3
+ kind: tuition
4
+ version: 1
5
+ id: T-015
6
+ project: tiphys-kernel
7
+ date: 2026-08-12
8
+ stage: orchestrator paperwork, across one branch
9
+ kernel-relevant: true
10
+ what-happened: >-
11
+ A document that grows at the TOP moves every line below the insertion point.
12
+ A citation of the form path:line into such a file is therefore correct when
13
+ written and wrong after the next append, and it fails silently: the line still
14
+ exists, so the citation resolves, and it now points at something else. Four
15
+ instances were found in one branch, every one of them by re-running the check
16
+ after the final edit rather than by reading.
17
+ lesson:
18
+ - >-
19
+ A positional citation into an append-at-top document decays on every
20
+ append, and the decayed form RESOLVES, so nothing reddens.
21
+ - >-
22
+ Prefer citing something that does not move, and where the positional
23
+ citation is the right one anyway, resolve it after the final edit and not
24
+ before.
25
+ - >-
26
+ The check that catches this is a re-run, not a reading.
27
+ structural-consequence:
28
+ - target: gate-registry.yaml
29
+ status: proposed
30
+ change: >-
31
+ The citations gate's document globs reach only the delivery tree today.
32
+ Extending them to root-level authored files would put this region under
33
+ the same check as everything else; the change belongs to the phase that
34
+ owns the registry rather than to this record.
35
+ evidence:
36
+ - delivery/tuition/T-015-a-citation-into-a-newest-at-top-file-rots-on-every-append.md, the four instances and the measurement
@@ -0,0 +1,36 @@
1
+ # T-016: an acknowledged alarm says nothing new when the state actually
2
+ # changes. Promoted by M3-P8.
3
+ kind: tuition
4
+ version: 1
5
+ id: T-016
6
+ project: tiphys-kernel
7
+ date: 2026-08-12
8
+ stage: orchestrator supervision, one session
9
+ kernel-relevant: true
10
+ what-happened: >-
11
+ A staleness alarm fired, was checked, and was correctly judged a false
12
+ positive against a live agent. The alarm kept reporting the same condition in
13
+ the same words afterwards, so when the underlying state actually changed there
14
+ was nothing new to notice: the message for "still quiet and known healthy" and
15
+ the message for "was alive when last checked, is not now" were identical. An
16
+ acknowledged alarm that repeats itself is a silence with extra steps.
17
+ lesson:
18
+ - >-
19
+ A guard should report a TRANSITION, not a level. Only the transition is
20
+ worth waking someone for.
21
+ - >-
22
+ An acknowledged alarm should be latched with the state it was acknowledged
23
+ AT, and re-fire when the state CHANGES from that, in different words.
24
+ - >-
25
+ The liveness signal has to be part of the guard rather than a separate
26
+ manual step, because a guard that cannot see what the operator saw cannot
27
+ tell the two states apart.
28
+ structural-consequence:
29
+ - target: src/liveness.ts
30
+ status: proposed
31
+ change: >-
32
+ The guard's verdict should carry the transition rather than the level, and
33
+ an acknowledged verdict should be latched at the state it was acknowledged
34
+ at, so the next report differs when the state does.
35
+ evidence:
36
+ - delivery/tuition/T-016-an-acknowledged-alarm-says-nothing-new-when-the-state-changes.md, the session it was measured in
@@ -0,0 +1,46 @@
1
+ # T-017: the beacon instruction asks for a habit, and habits do not survive a
2
+ # working agent. Promoted by M3-P8.
3
+ kind: tuition
4
+ version: 1
5
+ id: T-017
6
+ project: tiphys-kernel
7
+ date: 2026-08-12
8
+ stage: dispatch contract, four instances in one session
9
+ kernel-relevant: true
10
+ what-happened: >-
11
+ The dispatch contract tells every agent to create its work history early and
12
+ append as it works, because the file's mtime is the beacon its supervisor
13
+ watches. Four times in one session an agent working hard went quiet for long
14
+ enough to read as possibly dead, twice with the same number of minutes, because
15
+ "append as you work" names no moment at which to append. A second, sharper
16
+ instance came from fusing two acts in one instruction: an agent told to commit
17
+ and push on every append pushed six times, cancelling five in-flight CI runs
18
+ and leaving the critical-path branch with no completed evidence for two hours.
19
+ lesson:
20
+ - >-
21
+ An instruction that asks for a habit names no moment. A per-action trigger
22
+ ("append after each command whose output you will cite, before running the
23
+ next one") names one, which is a fact about the two texts rather than a
24
+ prediction that rewording will hold.
25
+ - >-
26
+ Committing locally satisfies durability; pushing is a separate act that
27
+ cancels in-flight CI, and fusing them into one instruction is how an
28
+ obedient agent destroys its own evidence.
29
+ - >-
30
+ The watcher should be able to distinguish "alive and not appending" from
31
+ "possibly dead", which is a distinction that belongs in the guard rather
32
+ than in one session's scripts.
33
+ structural-consequence:
34
+ - target: roles/implementer.md
35
+ status: applied
36
+ change: >-
37
+ The incremental-output clause carries the per-action trigger rather than
38
+ the habit, so the brief names a moment at which to append.
39
+ - target: src/watcher.ts
40
+ status: proposed
41
+ change: >-
42
+ The guard cannot today tell "alive and not appending" from "possibly
43
+ dead"; carrying the agent's own liveness signal rather than only mtimes is
44
+ what would separate them.
45
+ evidence:
46
+ - delivery/tuition/T-017-the-beacon-instruction-asks-for-a-habit.md, the four instances and the postscript on the fused instruction
@@ -0,0 +1,84 @@
1
+ # T-018: two checks that catch the same input make each other unwitnessable.
2
+ # Promoted by M3-P8, which also carries this entry's mechanism into the index.
3
+ kind: tuition
4
+ version: 1
5
+ id: T-018
6
+ project: tiphys-kernel
7
+ date: 2026-08-12
8
+ stage: M3-P6 fix round 2 (the brief drift check)
9
+ kernel-relevant: true
10
+ what-happened: >-
11
+ A red-witness member mutated one of two checks that reject the same input.
12
+ Neither check is individually necessary, so the mutation left the other one
13
+ covering the arm and no named test could reach the mutated line. The harness
14
+ correctly reported that nothing reddened, and the instruction derived from
15
+ reading that message literally ("write a test that reaches this line") was
16
+ impossible to satisfy. The round tried the instructed fix first, watched it
17
+ stay red, and then read the runner. The same phase's reviews found the wider
18
+ version of the same shape: a check that renders an artifact and compares the
19
+ artifact to that rendering can only see drift BETWEEN the two, so a narrowing
20
+ INSIDE the loop is a fixed point of it and is silent.
21
+ lesson:
22
+ - >-
23
+ Redundancy that cannot be observed is indistinguishable from dead code. A
24
+ line can be un-reddenable not because no test exercises the feature, but
25
+ because a second line in front of it rejects every input that would reach
26
+ it.
27
+ - >-
28
+ Reordering does not dissolve it; it only changes which of the two is
29
+ shadowed.
30
+ - >-
31
+ A gate message that names a line is naming a symptom. The reading is the
32
+ part that has to be earned, and the wrong reading was tried first here.
33
+ mechanisms:
34
+ - mechanism: Checking a generated artifact against its own generator
35
+ rule: >-
36
+ A check that renders an artifact and then compares the artifact to that
37
+ rendering can only see drift BETWEEN the two, so any narrowing INSIDE the
38
+ loop is a fixed point of it and is silent. Three seats can choose what
39
+ gets compared and all three have now been occupied by a real finding: the
40
+ MODE, when it is read out of the artifact being audited; the UNIT COUNT,
41
+ when the generator computes it; and the SELECTION, inside the generator
42
+ itself. Two rules follow. A CHECK WHOSE SUBJECT IS SELECTED BY A VALUE
43
+ READ FROM THE ARTIFACT IT AUDITS CAN BE SILENTLY NARROWED BY EDITING THAT
44
+ ARTIFACT, so pin the subject OUTSIDE the artifact and refuse a
45
+ disagreement in every mode, `--write` included, because `--write` is the
46
+ command that launders a narrowing into the shipped bytes. And A UNIT COUNT
47
+ THAT DOES NOT MEASURE WHAT WAS COMPARED CANNOT MAKE THE VACUITY GUARD
48
+ FIRE, so count the rows actually compared and never add a mode-independent
49
+ term, which gives the count a floor it can never fall below. Closing the
50
+ third seat needs a SECOND, INDEPENDENT statement of what the artifact must
51
+ contain, derived from the AUTHORITY and never routed through the
52
+ generator; nothing that calls the generator can close it. Make that
53
+ statement SET EQUALITY AND FIELD PRESENCE, not containment: dropping rows
54
+ and dropping a column from rows that all survive are structurally
55
+ different members, and each is invisible to the assertion that catches the
56
+ other. State it in two places that fail independently, and derive per item
57
+ at run time rather than pinning a count, because these registries are
58
+ append-only.
59
+ siblings:
60
+ - scripts/check-brief-drift.mjs
61
+ - scripts/render-agent-rules-gates.mjs
62
+ - src/roles.ts
63
+ - test/implementer-brief.test.ts
64
+ evidence:
65
+ - CV-1 and contract A finding 3 in delivery/review/clean-room-m3-p6-criteria.md, two clean-room contracts reaching the mode seat from different directions on one head
66
+ - DV-1 in delivery/review/verification-m3-p6-fix-round.md, the selection seat, silent to the whole suite and to every gate in the PR bundle
67
+ - "M3-P6 fix round 2 measured `scripts/render-agent-rules-gates.mjs` carrying the same defect UNFIXED: its rowCount is registry-derived, so the check reports 15 gates over a CLAUDE.md block holding 13, with the suite green"
68
+ structural-consequence:
69
+ - target: scripts/check-brief-drift.mjs
70
+ status: applied
71
+ change: >-
72
+ The drift check pins its subject outside the artifact it audits and counts
73
+ the rows actually compared, so a narrowing inside the loop cannot be
74
+ silent.
75
+ - target: test/implementer-brief.test.ts
76
+ status: applied
77
+ change: >-
78
+ A second, independent statement of what the brief must contain is derived
79
+ from the authority rather than from the generator, and it asserts set
80
+ equality and field presence rather than containment.
81
+ evidence:
82
+ - delivery/tuition/T-018-two-checks-catching-the-same-input-make-each-other-unwitnessable.md, the round's account and the correction
83
+ - delivery/review/verification-m3-p6-fix-round.md, the delta verification that found the selection seat
84
+ - delivery/work-history/m3-p6.md, the round that tried the instructed fix first
@@ -0,0 +1,40 @@
1
+ # T-021: MIGRATION TICKET, not an incident. Plan v1 section 11 item 7 parked
2
+ # two L1 enforcement items for the tuition flow to carry; this is the first.
3
+ # Recorded here at M3-P8 and executed post-M3.
4
+ kind: tuition
5
+ version: 1
6
+ id: T-021
7
+ project: tiphys-kernel
8
+ date: 2026-08-12
9
+ stage: M3-P8, recorded as a migration ticket
10
+ kernel-relevant: true
11
+ what-happened: >-
12
+ Plan v1 decision D-9 places "a review is never skipped" in Layer 1, meaning
13
+ enforced by the substrate rather than by an agent obeying a brief. The
14
+ substrate half is branch protection whose required checks depend on the
15
+ delivery mode: full mode requires the review gates, local-only mode cannot
16
+ require a pull request at all. None of it is built. Today the rule lives in
17
+ the orchestrator's brief and in the gate registry's applicability, which is
18
+ Layer 2: it holds while every agent obeys, and it has no floor under it if one
19
+ does not. This entry exists so the gap is a tracked artifact rather than a
20
+ sentence in a plan nobody re-reads.
21
+ lesson:
22
+ - >-
23
+ A rule enforced only by a brief is enforced by whoever is reading the
24
+ brief. Recording the intended enforcement layer next to the rule is what
25
+ makes the gap visible.
26
+ - >-
27
+ Mode-awareness is the hard half. A protection rule that assumes a pull
28
+ request breaks local-only mode, so the enforcement has to be derived from
29
+ the charter's delivery mode rather than fixed.
30
+ structural-consequence:
31
+ - target: gate-registry.yaml
32
+ status: ticketed
33
+ change: >-
34
+ Mode-aware branch-protection enforcement of the never-skipped review, so
35
+ the rule has a Layer 1 floor rather than living only in a brief. Executed
36
+ post-M3, per plan v1 section 11 item 7.
37
+ record: delivery/plan/kernel-plan-v1.md section 11 item 7 (D-9)
38
+ evidence:
39
+ - delivery/plan/kernel-plan-v1.md, section 11 item 7, which parks both L1 items for the tuition flow to carry
40
+ - delivery/decisions/DR-0012-delegated-merge-authority.md, the delegation this rule protects
@@ -0,0 +1,36 @@
1
+ # T-022: MIGRATION TICKET, not an incident. The second of the two L1 items plan
2
+ # v1 section 11 item 7 parked for this moment. Recorded at M3-P8, executed
3
+ # post-M3.
4
+ kind: tuition
5
+ version: 1
6
+ id: T-022
7
+ project: tiphys-kernel
8
+ date: 2026-08-12
9
+ stage: M3-P8, recorded as a migration ticket
10
+ kernel-relevant: true
11
+ what-happened: >-
12
+ Plan v1 decision D-10 places "validate before you push" in Layer 1: a push
13
+ that has not been through the validator is refused by the substrate, not by
14
+ the agent remembering. Nothing enforces it today. The validator exists as of
15
+ M3-P1 and the gates run in CI, which means the failure is caught AFTER the
16
+ push rather than before it, and the cost of that ordering is a red run, a
17
+ cancelled bundle and a round trip for something a pre-push check would have
18
+ named in a second.
19
+ lesson:
20
+ - >-
21
+ A check that runs after the act it was supposed to prevent is a report,
22
+ not an enforcement.
23
+ - >-
24
+ The pre-validation check must be derivable from the same registry CI uses,
25
+ or it becomes a second list that drifts from the first.
26
+ structural-consequence:
27
+ - target: gate-registry.yaml
28
+ status: ticketed
29
+ change: >-
30
+ A pre-push validation check derived from the registry's local-only mode,
31
+ so the same declarations drive both the pre-push refusal and the CI
32
+ bundle. Executed post-M3, per plan v1 section 11 item 7.
33
+ record: delivery/plan/kernel-plan-v1.md section 11 item 7 (D-10)
34
+ evidence:
35
+ - delivery/plan/kernel-plan-v1.md, section 11 item 7, which parks both L1 items for the tuition flow to carry
36
+ - delivery/work-history/m3-p1.md, the validator this check would call