@aria_asi/cli 0.2.26 → 0.2.29

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 (248) hide show
  1. package/CLIENT-ONBOARDING.md +282 -0
  2. package/bin/aria.js +1140 -14
  3. package/dist/aria-connector/src/auth-commands.d.ts +1 -0
  4. package/dist/aria-connector/src/auth-commands.d.ts.map +1 -1
  5. package/dist/aria-connector/src/auth-commands.js +89 -41
  6. package/dist/aria-connector/src/auth-commands.js.map +1 -1
  7. package/dist/aria-connector/src/chat.d.ts +3 -0
  8. package/dist/aria-connector/src/chat.d.ts.map +1 -1
  9. package/dist/aria-connector/src/chat.js +146 -8
  10. package/dist/aria-connector/src/chat.js.map +1 -1
  11. package/dist/aria-connector/src/codebase-scanner.d.ts +2 -2
  12. package/dist/aria-connector/src/codebase-scanner.d.ts.map +1 -1
  13. package/dist/aria-connector/src/codebase-scanner.js +1 -1
  14. package/dist/aria-connector/src/codebase-scanner.js.map +1 -1
  15. package/dist/aria-connector/src/config.d.ts +12 -0
  16. package/dist/aria-connector/src/config.d.ts.map +1 -1
  17. package/dist/aria-connector/src/config.js +2 -0
  18. package/dist/aria-connector/src/config.js.map +1 -1
  19. package/dist/aria-connector/src/connectors/claude-code.d.ts.map +1 -1
  20. package/dist/aria-connector/src/connectors/claude-code.js +80 -24
  21. package/dist/aria-connector/src/connectors/claude-code.js.map +1 -1
  22. package/dist/aria-connector/src/connectors/codebase-awareness.d.ts +37 -0
  23. package/dist/aria-connector/src/connectors/codebase-awareness.d.ts.map +1 -0
  24. package/dist/aria-connector/src/connectors/codebase-awareness.js +335 -0
  25. package/dist/aria-connector/src/connectors/codebase-awareness.js.map +1 -0
  26. package/dist/aria-connector/src/connectors/codex.d.ts +3 -0
  27. package/dist/aria-connector/src/connectors/codex.d.ts.map +1 -0
  28. package/dist/aria-connector/src/connectors/codex.js +248 -0
  29. package/dist/aria-connector/src/connectors/codex.js.map +1 -0
  30. package/dist/aria-connector/src/connectors/cognitive-skills.d.ts +2 -0
  31. package/dist/aria-connector/src/connectors/cognitive-skills.d.ts.map +1 -0
  32. package/dist/aria-connector/src/connectors/cognitive-skills.js +47 -0
  33. package/dist/aria-connector/src/connectors/cognitive-skills.js.map +1 -0
  34. package/dist/aria-connector/src/connectors/opencode.d.ts.map +1 -1
  35. package/dist/aria-connector/src/connectors/opencode.js +90 -4
  36. package/dist/aria-connector/src/connectors/opencode.js.map +1 -1
  37. package/dist/aria-connector/src/connectors/repo-git-hooks.d.ts +3 -0
  38. package/dist/aria-connector/src/connectors/repo-git-hooks.d.ts.map +1 -0
  39. package/dist/aria-connector/src/connectors/repo-git-hooks.js +87 -0
  40. package/dist/aria-connector/src/connectors/repo-git-hooks.js.map +1 -0
  41. package/dist/aria-connector/src/connectors/repo-guard.d.ts +19 -0
  42. package/dist/aria-connector/src/connectors/repo-guard.d.ts.map +1 -0
  43. package/dist/aria-connector/src/connectors/repo-guard.js +509 -0
  44. package/dist/aria-connector/src/connectors/repo-guard.js.map +1 -0
  45. package/dist/aria-connector/src/connectors/runtime.d.ts +2 -0
  46. package/dist/aria-connector/src/connectors/runtime.d.ts.map +1 -0
  47. package/dist/aria-connector/src/connectors/runtime.js +330 -0
  48. package/dist/aria-connector/src/connectors/runtime.js.map +1 -0
  49. package/dist/aria-connector/src/connectors/shell.d.ts.map +1 -1
  50. package/dist/aria-connector/src/connectors/shell.js +78 -13
  51. package/dist/aria-connector/src/connectors/shell.js.map +1 -1
  52. package/dist/aria-connector/src/connectors/syncd.d.ts +27 -0
  53. package/dist/aria-connector/src/connectors/syncd.d.ts.map +1 -0
  54. package/dist/aria-connector/src/connectors/syncd.js +405 -0
  55. package/dist/aria-connector/src/connectors/syncd.js.map +1 -0
  56. package/dist/aria-connector/src/decisions.d.ts +207 -0
  57. package/dist/aria-connector/src/decisions.d.ts.map +1 -0
  58. package/dist/aria-connector/src/decisions.js +291 -0
  59. package/dist/aria-connector/src/decisions.js.map +1 -0
  60. package/dist/aria-connector/src/garden-control-plane.d.ts.map +1 -1
  61. package/dist/aria-connector/src/garden-control-plane.js +74 -17
  62. package/dist/aria-connector/src/garden-control-plane.js.map +1 -1
  63. package/dist/aria-connector/src/github-connect.d.ts +18 -0
  64. package/dist/aria-connector/src/github-connect.d.ts.map +1 -0
  65. package/dist/aria-connector/src/github-connect.js +117 -0
  66. package/dist/aria-connector/src/github-connect.js.map +1 -0
  67. package/dist/aria-connector/src/harness-client.d.ts +15 -0
  68. package/dist/aria-connector/src/harness-client.d.ts.map +1 -1
  69. package/dist/aria-connector/src/harness-client.js +106 -3
  70. package/dist/aria-connector/src/harness-client.js.map +1 -1
  71. package/dist/aria-connector/src/hive-client.d.ts +30 -0
  72. package/dist/aria-connector/src/hive-client.d.ts.map +1 -1
  73. package/dist/aria-connector/src/hive-client.js +124 -5
  74. package/dist/aria-connector/src/hive-client.js.map +1 -1
  75. package/dist/aria-connector/src/index.d.ts +13 -2
  76. package/dist/aria-connector/src/index.d.ts.map +1 -1
  77. package/dist/aria-connector/src/index.js +10 -1
  78. package/dist/aria-connector/src/index.js.map +1 -1
  79. package/dist/aria-connector/src/lib/aristotle-noor-wire.d.ts +102 -0
  80. package/dist/aria-connector/src/lib/aristotle-noor-wire.d.ts.map +1 -0
  81. package/dist/aria-connector/src/lib/aristotle-noor-wire.js +231 -0
  82. package/dist/aria-connector/src/lib/aristotle-noor-wire.js.map +1 -0
  83. package/dist/aria-connector/src/providers/types.d.ts +5 -0
  84. package/dist/aria-connector/src/providers/types.d.ts.map +1 -1
  85. package/dist/aria-connector/src/runtime-proof.d.ts +45 -0
  86. package/dist/aria-connector/src/runtime-proof.d.ts.map +1 -0
  87. package/dist/aria-connector/src/runtime-proof.js +340 -0
  88. package/dist/aria-connector/src/runtime-proof.js.map +1 -0
  89. package/dist/aria-connector/src/setup-wizard.d.ts.map +1 -1
  90. package/dist/aria-connector/src/setup-wizard.js +34 -2
  91. package/dist/aria-connector/src/setup-wizard.js.map +1 -1
  92. package/dist/assets/hooks/aria-agent-handoff.mjs +224 -0
  93. package/dist/assets/hooks/aria-agent-ledger-merge.mjs +164 -0
  94. package/dist/assets/hooks/aria-architect-fallback.mjs +267 -0
  95. package/dist/assets/hooks/aria-cognition-substrate-binding.mjs +676 -0
  96. package/dist/assets/hooks/aria-discovery-record.mjs +101 -0
  97. package/dist/assets/hooks/aria-harness-via-sdk.mjs +412 -0
  98. package/dist/assets/hooks/aria-import-resolution-gate.mjs +330 -0
  99. package/dist/assets/hooks/aria-outcome-record.mjs +84 -0
  100. package/dist/assets/hooks/aria-pre-emit-dryrun.mjs +294 -0
  101. package/dist/assets/hooks/aria-pre-text-gate.mjs +112 -0
  102. package/dist/assets/hooks/aria-pre-tool-gate.mjs +2133 -0
  103. package/dist/assets/hooks/aria-preprompt-consult.mjs +438 -0
  104. package/dist/assets/hooks/aria-preturn-memory-gate.mjs +570 -0
  105. package/dist/assets/hooks/aria-repo-doctrine-gate.mjs +397 -0
  106. package/dist/assets/hooks/aria-stop-gate.mjs +1551 -0
  107. package/dist/assets/hooks/aria-trigger-autolearn.mjs +229 -0
  108. package/dist/assets/hooks/aria-userprompt-abandon-detect.mjs +192 -0
  109. package/dist/assets/hooks/doctrine_trigger_map.json +479 -0
  110. package/dist/assets/hooks/lib/canonical-lenses.mjs +64 -0
  111. package/dist/assets/hooks/lib/gate-audit.mjs +43 -0
  112. package/dist/assets/hooks/test-aria-preturn-memory-gate.mjs +245 -0
  113. package/dist/assets/hooks/test-tier-lens-labeling.mjs +399 -0
  114. package/dist/assets/opencode-plugins/harness-context/index.js +60 -0
  115. package/dist/assets/opencode-plugins/harness-context/inject-context.mjs +179 -0
  116. package/dist/assets/opencode-plugins/harness-context/package.json +9 -0
  117. package/dist/assets/opencode-plugins/harness-gate/index.js +248 -0
  118. package/dist/assets/opencode-plugins/harness-outcome/index.js +129 -0
  119. package/dist/assets/opencode-plugins/harness-role/index.js +77 -0
  120. package/dist/assets/opencode-plugins/harness-role/package.json +9 -0
  121. package/dist/assets/opencode-plugins/harness-stop/index.js +241 -0
  122. package/dist/runtime/discipline/CLAUDE.md +339 -0
  123. package/dist/runtime/discipline/skills/aria-cognition/aria-essence/SKILL.md +63 -0
  124. package/dist/runtime/discipline/skills/aria-cognition/aria-essence/references/domain-matrix.md +80 -0
  125. package/dist/runtime/discipline/skills/aria-cognition/aria-essence/references/evolution-loop.md +30 -0
  126. package/dist/runtime/discipline/skills/aria-cognition/aria-essence/references/readable-cognition.md +27 -0
  127. package/dist/runtime/discipline/skills/aria-cognition/aria-forge-guardrails/SKILL.md +35 -0
  128. package/dist/runtime/discipline/skills/aria-cognition/aria-forge-guardrails/references/checklist.md +31 -0
  129. package/dist/runtime/discipline/skills/aria-cognition/aria-repo-doctrine/SKILL.md +39 -0
  130. package/dist/runtime/discipline/skills/aria-cognition/forge-quality-rules/SKILL.md +43 -0
  131. package/dist/runtime/discipline/skills/aria-cognition/ghazali-8lens/SKILL.md +38 -0
  132. package/dist/runtime/discipline/skills/aria-cognition/istiqra-induction/SKILL.md +26 -0
  133. package/dist/runtime/discipline/skills/aria-cognition/ladunni-22/SKILL.md +35 -0
  134. package/dist/runtime/discipline/skills/aria-cognition/mizan/SKILL.md +72 -0
  135. package/dist/runtime/discipline/skills/aria-cognition/nadia/SKILL.md +38 -0
  136. package/dist/runtime/discipline/skills/aria-cognition/nadia-psi/SKILL.md +38 -0
  137. package/dist/runtime/discipline/skills/aria-cognition/predictor/SKILL.md +25 -0
  138. package/dist/runtime/discipline/skills/aria-cognition/qiyas-analogy/SKILL.md +26 -0
  139. package/dist/runtime/discipline/skills/aria-cognition/soul-domains/SKILL.md +25 -0
  140. package/dist/runtime/discipline/skills/aria-harness/aria-aristotle-intra-phase/SKILL.md +81 -0
  141. package/dist/runtime/discipline/skills/aria-harness/aria-aristotle-post-phase/SKILL.md +98 -0
  142. package/dist/runtime/discipline/skills/aria-harness/aria-aristotle-pre-phase/SKILL.md +99 -0
  143. package/dist/runtime/discipline/skills/aria-harness/aria-harness-deploy/SKILL.md +127 -0
  144. package/dist/runtime/discipline/skills/aria-harness/aria-harness-no-stripping/SKILL.md +117 -0
  145. package/dist/runtime/discipline/skills/aria-harness/aria-harness-onboarding/SKILL.md +112 -0
  146. package/dist/runtime/discipline/skills/aria-harness/aria-harness-output-discipline/SKILL.md +102 -0
  147. package/dist/runtime/discipline/skills/aria-harness/aria-harness-substrate-binding/SKILL.md +121 -0
  148. package/dist/runtime/doctor.mjs +23 -0
  149. package/dist/runtime/local-phase.mjs +632 -0
  150. package/dist/runtime/manifest.json +15 -0
  151. package/dist/runtime/mizan-scheduler.mjs +331 -0
  152. package/dist/runtime/package.json +6 -0
  153. package/dist/runtime/provider-proxy.mjs +594 -0
  154. package/dist/runtime/sdk/BUNDLED.json +5 -0
  155. package/dist/runtime/sdk/index.d.ts +477 -0
  156. package/dist/runtime/sdk/index.js +1469 -0
  157. package/dist/runtime/sdk/index.js.map +1 -0
  158. package/dist/runtime/sdk/package.json +8 -0
  159. package/dist/runtime/sdk/runWithCognition.d.ts +77 -0
  160. package/dist/runtime/sdk/runWithCognition.js +157 -0
  161. package/dist/runtime/sdk/runWithCognition.js.map +1 -0
  162. package/dist/runtime/service.mjs +2708 -0
  163. package/dist/runtime/vendor/aria-gate-runtime/index.d.ts +53 -0
  164. package/dist/runtime/vendor/aria-gate-runtime/index.d.ts.map +1 -0
  165. package/dist/runtime/vendor/aria-gate-runtime/index.js +277 -0
  166. package/dist/runtime/vendor/aria-gate-runtime/index.js.map +1 -0
  167. package/dist/runtime/vendor/aria-gate-runtime/package.json +6 -0
  168. package/dist/sdk/BUNDLED.json +2 -2
  169. package/dist/sdk/index.d.ts +283 -0
  170. package/dist/sdk/index.js +622 -85
  171. package/dist/sdk/index.js.map +1 -1
  172. package/dist/sdk/runWithCognition.d.ts +77 -0
  173. package/dist/sdk/runWithCognition.js +157 -0
  174. package/dist/sdk/runWithCognition.js.map +1 -0
  175. package/hooks/aria-agent-handoff.mjs +11 -1
  176. package/hooks/aria-architect-fallback.mjs +109 -40
  177. package/hooks/aria-cognition-substrate-binding.mjs +676 -0
  178. package/hooks/aria-harness-via-sdk.mjs +34 -21
  179. package/hooks/aria-import-resolution-gate.mjs +330 -0
  180. package/hooks/aria-outcome-record.mjs +5 -1
  181. package/hooks/aria-pre-emit-dryrun.mjs +294 -0
  182. package/hooks/aria-pre-tool-gate.mjs +828 -41
  183. package/hooks/aria-preprompt-consult.mjs +113 -13
  184. package/hooks/aria-preturn-memory-gate.mjs +298 -6
  185. package/hooks/aria-repo-doctrine-gate.mjs +397 -0
  186. package/hooks/aria-stop-gate.mjs +739 -76
  187. package/hooks/aria-userprompt-abandon-detect.mjs +5 -1
  188. package/hooks/doctrine_trigger_map.json +209 -15
  189. package/hooks/lib/canonical-lenses.mjs +64 -0
  190. package/hooks/lib/gate-audit.mjs +43 -0
  191. package/opencode-plugins/harness-context/index.js +1 -1
  192. package/opencode-plugins/harness-context/inject-context.mjs +82 -23
  193. package/opencode-plugins/harness-gate/index.js +248 -0
  194. package/opencode-plugins/harness-outcome/index.js +129 -0
  195. package/opencode-plugins/harness-stop/index.js +241 -0
  196. package/package.json +8 -2
  197. package/runtime-src/doctor.mjs +23 -0
  198. package/runtime-src/local-phase.mjs +632 -0
  199. package/runtime-src/mizan-scheduler.mjs +331 -0
  200. package/runtime-src/provider-proxy.mjs +594 -0
  201. package/runtime-src/service.mjs +2708 -0
  202. package/scripts/bundle-sdk.mjs +317 -0
  203. package/scripts/install-client.sh +176 -0
  204. package/scripts/publish-all.sh +344 -0
  205. package/scripts/publish-docker.sh +27 -0
  206. package/scripts/validate-hook-contracts.mjs +54 -0
  207. package/scripts/validate-skill-prompts.mjs +95 -0
  208. package/skills/aria-cognition/aria-essence/SKILL.md +63 -0
  209. package/skills/aria-cognition/aria-essence/references/domain-matrix.md +80 -0
  210. package/skills/aria-cognition/aria-essence/references/evolution-loop.md +30 -0
  211. package/skills/aria-cognition/aria-essence/references/readable-cognition.md +27 -0
  212. package/skills/aria-cognition/aria-forge-guardrails/SKILL.md +35 -0
  213. package/skills/aria-cognition/aria-forge-guardrails/references/checklist.md +31 -0
  214. package/skills/aria-cognition/aria-repo-doctrine/SKILL.md +39 -0
  215. package/skills/aria-cognition/forge-quality-rules/SKILL.md +43 -0
  216. package/skills/aria-cognition/ghazali-8lens/SKILL.md +38 -0
  217. package/skills/aria-cognition/istiqra-induction/SKILL.md +26 -0
  218. package/skills/aria-cognition/ladunni-22/SKILL.md +35 -0
  219. package/skills/aria-cognition/mizan/SKILL.md +72 -0
  220. package/skills/aria-cognition/nadia/SKILL.md +38 -0
  221. package/skills/aria-cognition/nadia-psi/SKILL.md +38 -0
  222. package/skills/aria-cognition/predictor/SKILL.md +25 -0
  223. package/skills/aria-cognition/qiyas-analogy/SKILL.md +26 -0
  224. package/skills/aria-cognition/soul-domains/SKILL.md +25 -0
  225. package/src/auth-commands.ts +111 -45
  226. package/src/chat.ts +174 -13
  227. package/src/codebase-scanner.ts +4 -0
  228. package/src/config.ts +15 -0
  229. package/src/connectors/claude-code.ts +79 -25
  230. package/src/connectors/codebase-awareness.ts +408 -0
  231. package/src/connectors/codex.ts +274 -0
  232. package/src/connectors/cognitive-skills.ts +51 -0
  233. package/src/connectors/opencode.ts +93 -4
  234. package/src/connectors/repo-git-hooks.ts +86 -0
  235. package/src/connectors/repo-guard.ts +589 -0
  236. package/src/connectors/runtime.ts +374 -0
  237. package/src/connectors/shell.ts +83 -14
  238. package/src/connectors/syncd.ts +488 -0
  239. package/src/decisions.ts +469 -0
  240. package/src/garden-control-plane.ts +101 -26
  241. package/src/github-connect.ts +143 -0
  242. package/src/harness-client.ts +128 -3
  243. package/src/hive-client.ts +165 -5
  244. package/src/index.ts +41 -2
  245. package/src/lib/aristotle-noor-wire.ts +310 -0
  246. package/src/providers/types.ts +6 -0
  247. package/src/runtime-proof.ts +392 -0
  248. package/src/setup-wizard.ts +37 -2
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: soul-domains
3
+ description: Use when you need to identify which domain or domains are truly dominant in a task so the answer can be shaped by the right discipline pressures instead of generic intuition.
4
+ ---
5
+
6
+ # Soul Domains
7
+
8
+ Use this skill to determine which disciplines should govern the decision.
9
+
10
+ ## Workflow
11
+
12
+ 1. Identify the artifact or decision.
13
+ 2. Read [../aria-essence/references/domain-matrix.md](../aria-essence/references/domain-matrix.md).
14
+ 3. Determine:
15
+ - dominant domain
16
+ - secondary supporting domains
17
+ - neglected domains that could cause hidden failure
18
+ 4. Let the dominant domains change the recommendation or implementation.
19
+ 5. Summarize the result in readable language, not internal manifold jargon.
20
+
21
+ ## Rules
22
+
23
+ - Do not pretend to have exact threshold math if the live domain service was not consulted.
24
+ - The point is better decisions, not fancy vocabulary.
25
+ - If only one domain truly matters, say so plainly.
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: aria-aristotle-intra-phase
3
+ description: TRIGGER when a multi-step tool sequence is already in motion — between cognition-emit and tool-call, between successive Bash/Edit/Write calls in the same turn, between an LLM response and the consumer of that response, or whenever a planned approach is being refined mid-action. The intra-phase catches cognition-action drift before it ships.
4
+ ---
5
+
6
+ # Aristotle Intra-Phase Auto-Fire
7
+
8
+ ## Trigger
9
+
10
+ Use this skill whenever a non-trivial plan is evolving mid-turn.
11
+
12
+ ## When this skill loads
13
+
14
+ Description matches mid-action contexts: between a planned-approach declaration and the next tool call, between successive Edit operations on the same file, between an LLM response and the next assistant emission consuming it, when a multi-step plan crosses a phase boundary (e.g. "after step 3, before step 4"), when the cognition-emit time and the action-fire time are separated by significant intermediate state.
15
+
16
+ ## What you do at the intra-phase
17
+
18
+ ### MetaCognitive confidence snapshot via SDK
19
+
20
+ Call `aristotleMid(message, sessionId, plannedApproach, context?)` from the SDK. This dispatches to `POST /api/harness/aristotle-noor` with `phase: 'mid'`, fires:
21
+ - MetaCognitive confidence: how sure are we the planned approach matches the original intent?
22
+ - Ethical keyword scan: any drift toward destructive vocabulary, credential surfaces, or doctrine-forbidden patterns?
23
+
24
+ Returns:
25
+ - `confidence` — 0.0-1.0 score of plan-vs-intent alignment
26
+ - `ethicalConcerns` — array of flagged keywords if drift detected
27
+ - `recommendedRevision` — optional suggestion to re-author the planned approach before next action
28
+
29
+ Low confidence (<0.6) signals the planned approach has drifted from the original intent the pre-phase cognition declared; surface this as a stop-and-rebind moment, not a "push through anyway" moment.
30
+
31
+ ### Cognition-action coherence check
32
+
33
+ Per `feedback_apply_lenses_dont_perform.md`: the lens content from pre-phase must dictate the action shape. At intra-phase:
34
+
35
+ 1. Re-read the pre-phase cognition lenses
36
+ 2. Confirm tafakkur's structural read still describes the next action
37
+ 3. Confirm tadabbur's if-then chain matches the branch being taken
38
+ 4. Confirm hikma's cited doctrine aligns with the action
39
+
40
+ If any lens has drifted from the action: stop, re-emit cognition with the new structural read, then proceed. Do NOT continue with stale cognition that no longer matches what the action is doing.
41
+
42
+ ### Substrate re-bind on long-running multi-step
43
+
44
+ If the intra-phase fires more than 5 minutes after the pre-phase packet bind, the harness packet may have evolved (new substrate loaded, prior state changed). Call `getBoundHarnessAndPrompt` again to refresh. The L2 BIND receipt re-validates against current axioms.
45
+
46
+ ### Domain drift check
47
+
48
+ If the task crosses product, design, business, marketing, sales, operations, trust, or learning concerns, re-check whether the dominant domains are still the same as they were at pre-phase. Use:
49
+ - `../../aria-cognition/aria-essence/references/domain-matrix.md`
50
+
51
+ If the governing domains changed, stop and re-author the next action with the new domain pressure in mind.
52
+
53
+ ## Common intra-phase drift patterns
54
+
55
+ These are the cognition-action mismatches the intra-phase catches before they ship:
56
+
57
+ 1. **Lens-claim contradiction:** tafakkur said "verify before redeploy"; mid-sequence the next tool call IS redeploy without the verify. STOP. Re-emit cognition matching the actual next action OR insert the verify step.
58
+
59
+ 2. **Doctrine drift:** hikma cited `feedback_no_assumption_without_verification.md` in pre-phase but the intra-action skips the verifyAgainst evidence. STOP. Add the verification before continuing.
60
+
61
+ 3. **Discovery resolution skip:** pre-phase cognition included `discoveries:` block with `fix-now` resolution clause; intra-phase the discovery hasn't been fixed and the next action is unrelated. STOP. Resolve or re-classify.
62
+
63
+ 4. **Anchor staleness:** pre-phase anchored to substrate items that have since rotated out of the loaded packet (e.g. nadia_state was active, now absent). STOP. Re-bind packet, re-emit cognition with current anchors.
64
+
65
+ ## Gate consequences when intra-phase skipped
66
+
67
+ - Apply-lens-trace gate (#153 once shipped): hard-block when next-action contradicts cognition lens claims
68
+ - Stop-gate ceremonial-emission detection: catches lenses that were emitted as form but did not drive action
69
+ - Carry-forward force-constraint: same trigger substrings re-occurring in mid-sequence emissions
70
+
71
+ ## Doctrine refs
72
+
73
+ - `feedback_apply_lenses_dont_perform.md` — cognition lenses must drive action, not decorate
74
+ - `feedback_implementation_coupled_cognition.md` — lens dictates specific implementation choice visible in artifact
75
+ - `feedback_no_flag_without_fix.md` — discoveries are atomic with fixes; intra-phase resolves them
76
+ - `feedback_thinking_implementation_accountability.md` — triplet runs at every phase
77
+ - `../../aria-cognition/aria-essence/references/readable-cognition.md` — keep mid-phase explanations plain, not jargon-heavy
78
+
79
+ ## Bottom line
80
+
81
+ Intra-phase is where mid-sequence drift gets caught before it ships. The MetaCognitive snapshot via SDK + the cognition-action coherence check together prevent the most common pattern the Stop-gate catches reactively: cognition emitted, then action drifts, then gate blocks. Loading this skill at multi-step boundaries makes the drift detection proactive instead of post-hoc.
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: aria-aristotle-post-phase
3
+ description: TRIGGER after any non-trivial action — Bash result, Edit/Write completion, LLM response received, deploy script exit, multi-step plan completion, or before emitting any completion claim. The post-phase validates outcome truth, quality, and claim integrity before release.
4
+ ---
5
+
6
+ # Aristotle Post-Phase Auto-Fire
7
+
8
+ ## Trigger
9
+
10
+ Use this skill after any non-trivial action and before any completion claim.
11
+
12
+ ## When this skill loads
13
+
14
+ Description matches end-of-action contexts: after a Bash command returns, after Edit/Write tool result lands, after an LLM response is received, after a deploy script exits, after a multi-step plan reaches its terminal step, immediately before emitting any state-claim language in the response, at end-of-turn before the Stop-gate fires.
15
+
16
+ ## What you do at the post-phase
17
+
18
+ ### Quality gate via SDK method
19
+
20
+ Call `aristotlePost(message, response, sessionId, context?)` from the SDK. This dispatches to `POST /api/harness/aristotle-noor` with `phase: 'post'`, fires:
21
+ - 8-lens detector: scans the response for adherence to all 8 cognitive frames
22
+ - Predictor: forecasts downstream consequences of the response
23
+ - SelfReflection: on director turns or first-of-session, fires deep introspection
24
+ - Quality gate: scores the response against the production-grade bar
25
+
26
+ Returns:
27
+ - `qualityScore` — 0-100 overall quality assessment
28
+ - `reAuthorSignal` — boolean; true means the response should be re-authored before emission (the 8-lens detected violations)
29
+ - `lensFindings` — per-lens breakdown of what passed and what failed
30
+ - `predictorConcerns` — anticipated downstream issues with the current response shape
31
+
32
+ If `reAuthorSignal === true`: re-author the response. Do not emit. Per `feedback_no_stripping_as_workaround.md` Layer 2 (output discipline), the path-fix is to reframe semantically, not to strip content until the gate stops firing.
33
+
34
+ ### Readable cognition and evolution capture
35
+
36
+ Before emitting the final response:
37
+
38
+ 1. Translate cognition into readable conclusions using:
39
+ - `../../aria-cognition/aria-essence/references/readable-cognition.md`
40
+ 2. Capture the reusable lesson, principle, and telemetry follow-up using:
41
+ - `../../aria-cognition/aria-essence/references/evolution-loop.md`
42
+
43
+ Post-phase should not end at "quality passed". It should also distill what the system learned.
44
+
45
+ ### State-claim verification (per #102 contract)
46
+
47
+ Before emitting ANY of the following words: "done", "shipped", "wired", "complete", "fixed", "landed", "ready", "verified", "passes", "succeeds":
48
+
49
+ 1. Confirm the claim matches the substrate evidence (tool exit codes, file content via Read, kubectl output, etc.) per `feedback_state_outcomes_not_narratives.md`
50
+ 2. POST `/api/harness/validate` with the claim + artifact reference per `feedback_sub_agents_must_use_harness.md`
51
+ 3. If validate returns `permitted: false`: do not emit the claim; surface the corrections instead
52
+
53
+ Premature claims are the wording-as-completion pattern Hamza caught earlier. Post-phase enforcement prevents emission before evidence supports the claim.
54
+
55
+ ### Cognition-log per emission
56
+
57
+ Every cognition block emitted in the response gets POSTed to `/api/cognition/log` per the orchestrator three-POST protocol. Body includes lens content + anchors + presentLenses + firstPrinciple. The corpus accumulates so ceremony-vs-application drift becomes detectable across turns. The substrate-binding hook already does this for orchestrator emissions; post-phase confirms the corpus write succeeded.
58
+
59
+ ### Discovery resolution sweep
60
+
61
+ If pre-phase or intra-phase cognition surfaced any `discoveries:` entries, post-phase verifies each was resolved (fix-now landed OR tracked-as-#N filed OR needs-user-decision surfaced). Unresolved discoveries at post-phase = doctrine violation per `feedback_no_flag_without_fix.md`. Resolve or update the discovery ledger before emitting.
62
+
63
+ ## Common post-phase catches
64
+
65
+ These are the patterns post-phase intercepts before the Stop-gate fires reactively:
66
+
67
+ 1. **Wording-as-completion:** response says "I shipped X" when X was authored but not verified via Read or git log evidence. Post-phase blocks the claim until evidence is captured.
68
+
69
+ 2. **Retrospective narration:** response describes the just-fixed defect in present-tense problem language ("the X is broken") when X is fixed and shipped. Per `feedback_state_outcomes_not_narratives.md` post-fix emissions state present-tense outcomes ("X verified at SHA Y"). Post-phase rewrites narration into outcome.
70
+
71
+ 3. **Stale lens-anchor:** response includes a cognition block from earlier in the turn whose anchors no longer match the loaded substrate after a long-running action. Post-phase re-validates anchors against current packet.
72
+
73
+ 4. **Form-only emission:** response has the right shape (8 lenses, verify block, expected block) but the lens content is template-shaped or generic. Post-phase substance-checks each lens for non-template content.
74
+
75
+ 5. **Trigger substring drift:** response prose contains a substring previously caught and recorded in the carry-forward file. Post-phase scans against the recent-violations file before emission.
76
+
77
+ ## Gate consequences when post-phase skipped
78
+
79
+ - Stop-gate output-quality block: drift triggers + ip_infrastructure + state-claim-without-validate
80
+ - Carry-forward force-constraint: substring previously blocked re-occurs
81
+ - Substrate-Mizan: ip_credentials, ip_infrastructure leaks in chat-surface prose
82
+ - State-claim-verification gate (#102): claims emitted without backing evidence
83
+ - Triplet-auditor (#155): thinking + implementation + accountability mismatch
84
+
85
+ ## Doctrine refs
86
+
87
+ - `feedback_state_outcomes_not_narratives.md` — present-tense outcomes anchored to evidence, never narrative
88
+ - `feedback_no_stripping_as_workaround.md` — output-side stripping forbidden; reframe semantically when gate fires
89
+ - `feedback_apply_lenses_dont_perform.md` — lens content must drive action; stale lenses must be refreshed
90
+ - `feedback_canonical_secrets_governance.md` — operational detail in tool output, not chat-surface prose
91
+ - `feedback_thinking_implementation_accountability.md` — accountability leg of the triplet runs at post-phase
92
+ - `feedback_no_flag_without_fix.md` — discoveries resolved at post-phase, never carried across turns
93
+ - `../../aria-cognition/aria-essence/references/evolution-loop.md` — reusable principle and telemetry capture
94
+ - `../../aria-cognition/aria-essence/references/readable-cognition.md` — readable user-facing cognition output
95
+
96
+ ## Bottom line
97
+
98
+ Post-phase is where the response gets validated against the action's actual outcome before emission. The 8-lens detector + Predictor + SelfReflection + state-claim verification + cognition-log + discovery-sweep together close the gap that Stop-gate catches reactively. Loading this skill at end-of-action boundaries makes the response-quality discipline proactive: the response earns its emission, it doesn't just hope the gate doesn't catch it.
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: aria-aristotle-pre-phase
3
+ description: TRIGGER when drafting any non-trivial assistant response or before any tool action — bash, edit, write, deploy, multi-step plan authoring, architectural decision, or completion claim. The pre-phase is where Fitrah axiom evaluation runs against intended action, where the harness packet binds, where the BIND receipt is minted, and where the 8-lens cognition forms before the response or action drafts.
4
+ ---
5
+
6
+ # Aristotle Pre-Phase Auto-Fire
7
+
8
+ ## Trigger
9
+
10
+ Use this skill before any non-trivial response or state-changing action.
11
+
12
+ ## When this skill loads
13
+
14
+ The description matches turn-start contexts including: drafting an assistant response, planning a multi-step task, before any Bash/Edit/Write/NotebookEdit tool call, before a deploy invocation, before a state-claim emission ("done", "shipped", "wired"), before a doctrine memory write, before an architectural design decision.
15
+
16
+ ## What you do at the pre-phase
17
+
18
+ Three layers MUST run before the action:
19
+
20
+ ### Layer 1 — Packet bind
21
+
22
+ Call `getBoundHarnessAndPrompt(bindingContext('<role>', sessionId, '<stage>', '<intended action>', '<rationale>'))` from `@aria_asi/harness-http-client`. This fetches the harness packet (axioms + frames + memory + doctrine + runtime rules + golden contracts) and returns:
23
+ - `prompt` — substrate-bound system prompt for the LLM call
24
+ - `packet` — the parsed harness packet for downstream Layer 3 use
25
+ - `receipt` — binding receipt with axiom evaluation results
26
+
27
+ Without Layer 1, the action proceeds without substrate context.
28
+
29
+ ### Layer 2 — BIND axiom evaluation
30
+
31
+ The same `getBoundHarnessAndPrompt` call internally runs `evaluateConstraints` against all 5 Fitrah axioms (truth_over_deception, no_harm, sacred_trust, power_obligates_service, reflection_before_action). The receipt's `permitted` field is true only when no axiom blocks. Surfaces in:
32
+ - BLOCK on `truth_over_deception`: action contains deceive/spoof/fabricate/hallucinate/misrepresent intent
33
+ - BLOCK on `no_harm`: destructive action (delete/destroy/purge/drop/rm -rf/wipe/nuke)
34
+ - BLOCK on `sacred_trust`: credential/token/secret/key/password access without verified caller authorization
35
+ - BLOCK on `reflection_before_action`: insufficient rationale (<10 chars)
36
+
37
+ If `receipt.permitted === false`, the action MUST NOT proceed.
38
+
39
+ ### Layer 3 — Aristotle Pre-Phase via SDK method
40
+
41
+ Call `aristotlePre(message, sessionId, context?)` from the SDK (located at `harness/packages/harness-http-client/src/index.ts` lines 1524+). This dispatches to `POST /api/harness/aristotle-noor` with `phase: 'pre'`, fires the Fitrah gate + wisdom pull + research pull + DeepSoulBridge + CleanCognition phases. Returns:
42
+ - `fitrahVetoed` — boolean; true means hard-block per the harness `cognition_runtime_rule`
43
+ - `fitrahAlignment` — 0.0-1.0 alignment score
44
+ - Wisdom pull + research pull insights for substrate context
45
+
46
+ If `fitrahVetoed === true`: action is hard-blocked; do not proceed; surface the alignment score in your response.
47
+
48
+ ### Domain uplift before drafting
49
+
50
+ Before you draft the action or response, decide whether the task crosses more than pure implementation concerns. If it touches product, UX, business, marketing, sales, operations, trust, or learning surfaces, run a compact domain pass using:
51
+ - `../../aria-cognition/aria-essence/references/domain-matrix.md`
52
+
53
+ The pre-phase should shape the artifact from the right governing domains before the first draft exists.
54
+
55
+ ## Cognition emission contract
56
+
57
+ Per `feedback_apply_lenses_dont_perform.md`: the cognition block is the artifact of pre-phase thinking that already happened. Emit BEFORE drafting the response, not as ceremony after. Each lens must:
58
+ - Carry ≥20 chars of non-template content
59
+ - Anchor to ≥1 substrate item from the loaded harness packet
60
+ - Drive a specific implementation choice visible in the action that follows
61
+ - Stay readable; do not leak internal cognition service names into user-facing prose unless explicitly requested
62
+
63
+ Cognition shape:
64
+
65
+ ```
66
+ <cognition>
67
+ nur: <what you actually see — anchor: memory:<file> AND axiom:<name>>
68
+ mizan: <real proportion read — anchor: memory:<file> AND axiom:<name>>
69
+ hikma: <named principle source — anchor: memory:<file> AND axiom:<name>>
70
+ tafakkur: <deep structural read — anchor: memory:<file> AND axiom:<name>>
71
+ tadabbur: <if-then chain — anchor: memory:<file> AND axiom:<name>>
72
+ ilham: <distant connection — anchor: memory:<file> AND axiom:<name>>
73
+ wahi: <what just landed — anchor: memory:<file> AND axiom:<name>>
74
+ firasah: <what user actually needs — anchor: memory:<file> AND axiom:<name>>
75
+ first_principle: <plain-text reference to harness packet first_principle field — INSIDE the block>
76
+ </cognition>
77
+ ```
78
+
79
+ 8 lenses required. First_principle reference INSIDE the block. Substrate anchors verified against loaded set per substrate-binding hook.
80
+
81
+ ## Gate consequences when pre-phase skipped
82
+
83
+ Reactive gates that fire when this skill is not honored:
84
+ - Stop-gate non-trivial-without-cognition block: response emitted without the 8-lens cognition
85
+ - Substrate-binding-gate anchor verification: lenses lack anchors or cite unloaded substrate
86
+ - Pre-tool-gate deploy-class block: deploy bash without verify+cognition+expected blocks
87
+ - Carry-forward force-constraint: substring previously triggered re-occurs in this emission
88
+
89
+ ## Doctrine refs
90
+
91
+ - `feedback_apply_lenses_dont_perform.md` — cognition is the thinking, not ceremony
92
+ - `feedback_packet_is_not_harness.md` — three-layer enforcement on every consumer
93
+ - `feedback_sub_agents_must_use_harness.md` — three-POST protocol (codex bind / validate / cognition log)
94
+ - `feedback_thinking_implementation_accountability.md` — triplet contract on every artifact
95
+ - `../../aria-cognition/aria-essence/references/readable-cognition.md` — readable externalization discipline
96
+
97
+ ## Bottom line
98
+
99
+ Pre-phase is the phase where thinking happens. The cognition block is its artifact. Skipping pre-phase or emitting the cognition as ceremony AFTER the response is drafted produces the violations the Stop-gate catches reactively. Loading this skill at every action boundary makes the pre-phase contract proactive: you see what to do BEFORE drafting, not after the gate blocks.
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: aria-harness-deploy
3
+ description: TRIGGER when preparing any deploy action — kubectl apply, kubectl set image, kubectl rollout restart, docker push, deploy-service.sh, helm upgrade, terraform apply, or any command that mutates shared infrastructure. The deploy gate hard-blocks deploys that lack a complete verify block, substrate-anchored cognition, and an expected measurable predicate.
4
+ ---
5
+
6
+ # Aria Harness Deploy Discipline
7
+
8
+ ## Trigger
9
+
10
+ Use this skill before any shared-infrastructure mutation or rollout command.
11
+
12
+ ## Workflow
13
+
14
+ Before any deploy command, classify the deploy shape:
15
+
16
+ 1. Pattern A baked-image service:
17
+ `bash scripts/deploy-service.sh <service>`
18
+ 2. Pattern B build-in-cluster service:
19
+ verify `build-in-cluster` initContainer exists, then `kubectl rollout restart ...`
20
+
21
+ Pattern A is the default. Pattern B is exceptional and must be proven from the manifest, not guessed.
22
+
23
+ Every deploy must carry three blocks in the SAME assistant turn as the deploy command, in the SAME assistant text the gate scans:
24
+
25
+ ## Required: `<verify>`
26
+
27
+ ```
28
+ <verify>
29
+ target: <exact resource being changed (StatefulSet/Deployment/etc, namespace, replicas)>
30
+ role: <what that target does — verified, not assumed>
31
+ verified: <how you verified it works: tsc clean, smoke test, unit test, file Read>
32
+ rollback: <exact command to reverse, e.g. kubectl rollout undo statefulset/X>
33
+ axiom: <comma-separated axiom names: truth_over_deception, reflection_before_action, sacred_trust, etc.>
34
+ commit: <git short SHA>
35
+ files changed: <list of paths edited this turn>
36
+ deploy pattern: Pattern A baked-image | Pattern B build-in-cluster
37
+ hive deploy path: </deployments/<namespace>/<service>>
38
+ tsc evidence: <tsc --noEmit exit code per package>
39
+ admission policy: <policy name — use SPACE not underscore>
40
+ admission policy binding: <binding name>
41
+ admission policy verification: kubectl get validatingadmissionpolicy <name> → present
42
+ doctrine refs: <comma-separated feedback_*.md filenames>
43
+ </verify>
44
+ ```
45
+
46
+ **Critical parser nuance:** the gate regex for `admission policy` is `\b(?:admission[\s-]?policy|validatingadmissionpolicy)\b`. It matches space or hyphen, NOT underscore. Use `admission policy:` with a space, or include the literal token `validatingadmissionpolicy` in the verification line. Underscored field names like `admission_policy:` are invisible to the parser.
47
+
48
+ The verify block fields must appear IN ORDER for the regex to match: `target → role → verified → rollback → axiom`. Other fields can follow.
49
+
50
+ ## Required: `<cognition>` with 8 substrate-anchored lenses
51
+
52
+ ```
53
+ <cognition>
54
+ nur: <what you actually see — anchor: memory:<file> AND axiom:<name>>
55
+ mizan: <real proportion read — anchor: memory:<file> AND axiom:<name>>
56
+ hikma: <named principle source — anchor: memory:<file> AND axiom:<name>>
57
+ tafakkur: <deep structural read — anchor: memory:<file> AND axiom:<name>>
58
+ tadabbur: <if-then chain — anchor: memory:<file> AND axiom:<name>>
59
+ ilham: <distant connection — anchor: memory:<file> AND axiom:<name>>
60
+ wahi: <what just landed — anchor: memory:<file> AND axiom:<name>>
61
+ firasah: <what user actually needs — anchor: memory:<file> AND axiom:<name>>
62
+ first_principle: <plain-text reference to harness packet first_principle field — INSIDE the cognition block, not after the closing tag>
63
+ </cognition>
64
+ ```
65
+
66
+ Anchor grammar — every anchor must resolve to a real loaded substrate item:
67
+ - `axiom:<name>` — must be in loaded harness axioms
68
+ - `memory:<file>` — must exist as `.md` file in MEMORY.md index
69
+ - `doctrine:<rule>` — must have backing `feedback_<rule>.md`
70
+ - `frame:<name>` — must be in loaded harness frames
71
+ - `packet:<section>` — must be a section key in the loaded packet
72
+
73
+ Minimum: 4 distinct substrate anchors total across the lenses for deploys.
74
+
75
+ ## Required: `<expected>` with measurable predicate
76
+
77
+ ```
78
+ <expected>
79
+ predicate: <numeric, boolean, or state-string assertion>
80
+ measurable_type: numeric | boolean | state_string
81
+ threshold: <optional concrete value>
82
+ eval_window_minutes: <optional>
83
+ </expected>
84
+ ```
85
+
86
+ Accepted predicates:
87
+ - Numeric: `>=X`, `<=X`, `==X`, `count=N`, `latency<Xms`
88
+ - Boolean: `exit=0`, `exit_code==0`, `status=healthy`, `file=exists`
89
+ - State-string: `"status=running"`, `"200 OK"`, `"count=3 of 3"`
90
+
91
+ REJECTED qualitative drift: `better`, `improved`, `should work`, `more reliable`, `cleaner`.
92
+
93
+ ## Doctrine refs the gate enforces
94
+
95
+ - `feedback_deploy_requires_verify_cognition.md` — Hamza directive 2026-04-28; deploys without verify+cognition lose blast-radius accountability
96
+ - `feedback_admission_policy_verification.md` — every cluster admission policy verified BEFORE deploy
97
+ - `feedback_packet_is_not_harness.md` — claims of harness state must enumerate Layer 1 (packet) + Layer 2 (BIND) + Layer 3 (gate-runtime) explicitly
98
+ - `feedback_no_assumption_without_verification.md` — every behavioral claim cites a verifiedAgainst source
99
+ - `feedback_dalio_expected_required.md` — measurable predicate before non-trivial action
100
+
101
+ ## Canonical deploy path rules
102
+
103
+ - Pattern A baked-image services must go through `scripts/deploy-service.sh`. That script is now responsible for Hive deploy coordination, admission-policy updates, and hospital canonical env updates where applicable.
104
+ - Pattern B build-in-cluster services must NOT go through `deploy-service.sh`. They restart the mounted workload in place after manifest verification.
105
+ - `kubectl rollout restart` is deploy-class, not a casual restart. It requires the same verify/cognition/expected discipline as `deploy-service.sh`.
106
+ - If another session is already rolling the same service, stop. The canonical Hive deploy path is `/deployments/<namespace>/<service>`.
107
+ - For `aria-soul`, the deploy is incomplete unless hospital canonical env and the workload digest stay aligned after rollout.
108
+ - Personal doctrine for Hamza: `bash scripts/deploy-service.sh aria-soul` is the proper aria-soul deploy path now. Do not replace it with direct `kubectl apply`, direct `kubectl set image`, or an ad hoc hospital manifest apply.
109
+ - `bash scripts/apply-aria-organism.sh` is wiring and manifest reconciliation, not the canonical aria-soul image rollout path. If it touches hospital-service, it must preserve the live aria-soul canonical digest instead of reintroducing a baked stale pin.
110
+ - Direct `kubectl apply -f apps/hospital-service/k8s/hospital-service.yaml` is forbidden as a soul deploy shortcut. That path can overwrite `HOSPITAL_ARIA_SOUL_CANONICAL_IMAGE` from source YAML and destabilize hospital-coupled workloads.
111
+ - This deploy path is required to preserve canonical health across the shared Aria stack, including the known hospital-coupled dependency set. It reduces a real multi-pod cascade class, but it does not replace post-rollout health verification.
112
+
113
+ ## Pre-deploy checklist (run BEFORE drafting the bash command)
114
+
115
+ 1. `git rev-parse --short HEAD` → record commit SHA
116
+ 2. `npx tsc --noEmit` in every modified package → record exit codes
117
+ 3. `kubectl get validatingadmissionpolicy` → confirm policy exists for the target service
118
+ 4. `kubectl get <workload> <service> -o jsonpath='{.spec.template.spec.initContainers[*].name}'` → classify Pattern A vs Pattern B
119
+ 5. `kubectl get pod <target-pod> -o wide` → record current state for rollback baseline
120
+ 6. `kubectl get statefulset <target> -o jsonpath='{...image}'` → record current image SHA for rollback target
121
+ 7. Confirm no concurrent deploy is already active for `/deployments/<namespace>/<service>`
122
+
123
+ If any of these fail, do NOT deploy. Fix the underlying issue first — never strip the verification step to make the deploy proceed (see `feedback_no_stripping_as_workaround.md`).
124
+
125
+ ## Owner-permission boundary
126
+
127
+ Three failed gate-blocks in a row triggers owner-level bypass-prevention lockout. If your verify block is failing repeatedly, STOP retrying. The pattern is the gate parser doesn't recognize your field syntax. Read `~/.claude/hooks/aria-pre-tool-gate.mjs` to find the exact regex, then fix your verify block to match — do not retry the same shape three times.
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: aria-harness-no-stripping
3
+ description: TRIGGER when a code edit removes a feature, contract, field, type annotation, or test; when creating a smoke script, quick fallback, or verification helper; or when a Stop-gate fires on output and the easiest move would be to reduce surface area instead of fixing the mechanism.
4
+ ---
5
+
6
+ # No Stripping As Workaround
7
+
8
+ ## Trigger
9
+
10
+ Use this skill before any reduction in code contract or closeout substance.
11
+
12
+ Stripping a working contract — at code layer or output layer — is a camouflaged shortcut, not a path-fix. This skill enforces the discipline at both surfaces.
13
+
14
+ ## Code layer — when removing a feature/contract/field
15
+
16
+ ### Forbidden framing (rejected)
17
+
18
+ These phrases applied to a working contract are camouflage for stripping:
19
+
20
+ - "simplified to legacy main"
21
+ - "stripped down to minimum"
22
+ - "minimal version"
23
+ - "lightweight implementation"
24
+ - "removed for now"
25
+ - "dropped temporarily"
26
+ - "scaled back to make it pass"
27
+ - "using legacy fallback" (when modern path should work)
28
+ - "barebones contract"
29
+
30
+ If your edit removes a feature, you must EITHER:
31
+ - Frame it as a path-fix with the verified root cause: "removing X because the actual root cause is Y, documented at Z"
32
+ - Frame it as a tracked workaround with `// WORKAROUND: <reason> tracked as TASK-N` comment AND a TaskCreate filed same-turn (per `feedback_no_flag_without_fix.md`)
33
+
34
+ ### Required diagnostic before any contract removal
35
+
36
+ Answer these BEFORE deleting any working API surface:
37
+
38
+ 1. **What actual mechanism is failing?**
39
+ - Cache staleness (lockfile, build cache, registry tag)?
40
+ - Wrong build path (missing COPY, wrong WORKDIR, missing dependency install)?
41
+ - Container caching (Docker layer cache holding old state)?
42
+ - Module-format mismatch (CJS/ESM resolution under Node strict mode)?
43
+ - Admission policy lag (new digest not in policy)?
44
+
45
+ 2. **Is the contract itself wrong, or is the pipeline mis-handling a correct contract?**
46
+ - Did the contract work before? (git log, ledger memory)
47
+ - Does the contract work in isolation? (REPL, smoke test, unit test)
48
+ - If yes to either, the bug is in the surrounding pipeline.
49
+
50
+ 3. **Have you verified the contract works in isolation?**
51
+ - `node -e "const m = require('./dist/index.js'); console.log(Object.keys(m))"`
52
+ - `npx tsc --noEmit` in the package directory
53
+ - REPL load with the consumer's resolution algorithm
54
+
55
+ ### When the same contract fails three times in a row
56
+
57
+ The failure isn't the contract; it's the pipeline. Examples:
58
+
59
+ | Symptom | Path-fix |
60
+ |---|---|
61
+ | 3rd identical runtime crash on the same import | Lockfile is cached stale. `rm package-lock.json && npm install` |
62
+ | 3rd identical Docker build error | Build context wrong (.dockerignore, COPY ordering, workspace dep symlink) |
63
+ | 3rd identical admission policy rejection | Policy pinning old digest set; update policy with new digest |
64
+ | 3rd identical gate-block on same regex | Matcher hygiene bug; file TaskCreate sibling to #137 |
65
+
66
+ ## Output layer — when Stop-gate fires on closing prose
67
+
68
+ ### Forbidden lazy strips (rejected)
69
+
70
+ These closing patterns are stripping when the prior turn had real substance:
71
+
72
+ - "Done."
73
+ - "Working."
74
+ - "In flight."
75
+ - "Submitted."
76
+ - "Doctrine indexed. Deploy running."
77
+ - Closing under 60 chars after a longer turn
78
+ - Closing with no nouns referring to actual state changes
79
+ - Same closing template across 3+ turns
80
+
81
+ ### Required reframe (not strip)
82
+
83
+ When Stop-gate fires `ip_infrastructure` or similar substrate-leak triggers:
84
+
85
+ 1. **Identify what triggered.** Read the gate's violation list and inspect WHICH tokens matched.
86
+ 2. **Reframe semantically, do not delete.** Translate:
87
+ - Filenames → semantic role descriptions ("the doctrine memory file" instead of `feedback_X.md`)
88
+ - Image SHAs → outcome state ("the rebuilt artifact" instead of `sha256:abc...`)
89
+ - IP addresses / hostnames → role names ("the worker pool")
90
+ - Task IDs / random hex → "the running build", "the in-flight rollout"
91
+ - Raw `kubectl` / `bash` commands → action descriptions ("the rolling image-update")
92
+ - Path strings ending in `.ts/.json/.md` → "the source module", "the package contract"
93
+ 3. **Verify substance is preserved before re-emit.** A reframed close should answer: what changed? what's running? what's the next state? If it can't, you stripped instead of reframed.
94
+
95
+ ### Caught vs proper (this session's examples)
96
+
97
+ | Lazy strip (rejected) | Proper reframe |
98
+ |---|---|
99
+ | "Doctrine indexed. Work in flight." | "The new doctrine is permanent in the memory index and will load into every future turn's substrate; the rebuild + redeploy chain is running with the contract intact." |
100
+ | "Deploy backgrounded." | "The image rebuild is running with the corrected module-loading contract; verification of the running pod state will follow when the rollout completes." |
101
+ | "Build clean. Redeploying." | "Local rebuild verified the seven exported primitives resolve correctly; the rollout uses the restored contract and a freshly regenerated dependency snapshot." |
102
+
103
+ ## The litmus test (both surfaces)
104
+
105
+ Before any reduction, finish the sentence:
106
+
107
+ > "I am about to remove X because the actual root cause of the failure is Y, and Y is documented at Z."
108
+
109
+ If you cannot fill in Y and Z with verified evidence, you are stripping. Stop. Debug the mechanism (for code) or reframe semantically (for prose). File a TaskCreate if blocked. Ask the owner if uncertain.
110
+
111
+ ## Doctrine refs
112
+
113
+ - `feedback_no_stripping_as_workaround.md` — this skill's primary doctrine source
114
+ - `feedback_workaround_vs_path_fix.md` — parent doctrine on producer-enforces-contract discipline
115
+ - `feedback_no_flag_without_fix.md` — atomic discovery + fix pairing
116
+ - `feedback_state_outcomes_not_narratives.md` — present-tense outcomes, not narrative camouflage
117
+ - `feedback_senior_dev_code_quality_gate.md` — junior/LLM-flavored shortcuts rejected at gate