@aria_asi/cli 0.2.26 → 0.2.30
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.
- package/CLIENT-ONBOARDING.md +282 -0
- package/bin/aria.js +1140 -14
- package/dist/aria-connector/src/auth-commands.d.ts +1 -0
- package/dist/aria-connector/src/auth-commands.d.ts.map +1 -1
- package/dist/aria-connector/src/auth-commands.js +89 -41
- package/dist/aria-connector/src/auth-commands.js.map +1 -1
- package/dist/aria-connector/src/chat.d.ts +3 -0
- package/dist/aria-connector/src/chat.d.ts.map +1 -1
- package/dist/aria-connector/src/chat.js +146 -8
- package/dist/aria-connector/src/chat.js.map +1 -1
- package/dist/aria-connector/src/codebase-scanner.d.ts +2 -2
- package/dist/aria-connector/src/codebase-scanner.d.ts.map +1 -1
- package/dist/aria-connector/src/codebase-scanner.js +1 -1
- package/dist/aria-connector/src/codebase-scanner.js.map +1 -1
- package/dist/aria-connector/src/config.d.ts +12 -0
- package/dist/aria-connector/src/config.d.ts.map +1 -1
- package/dist/aria-connector/src/config.js +2 -0
- package/dist/aria-connector/src/config.js.map +1 -1
- package/dist/aria-connector/src/connectors/claude-code.d.ts.map +1 -1
- package/dist/aria-connector/src/connectors/claude-code.js +80 -24
- package/dist/aria-connector/src/connectors/claude-code.js.map +1 -1
- package/dist/aria-connector/src/connectors/codebase-awareness.d.ts +37 -0
- package/dist/aria-connector/src/connectors/codebase-awareness.d.ts.map +1 -0
- package/dist/aria-connector/src/connectors/codebase-awareness.js +335 -0
- package/dist/aria-connector/src/connectors/codebase-awareness.js.map +1 -0
- package/dist/aria-connector/src/connectors/codex.d.ts +3 -0
- package/dist/aria-connector/src/connectors/codex.d.ts.map +1 -0
- package/dist/aria-connector/src/connectors/codex.js +248 -0
- package/dist/aria-connector/src/connectors/codex.js.map +1 -0
- package/dist/aria-connector/src/connectors/cognitive-skills.d.ts +2 -0
- package/dist/aria-connector/src/connectors/cognitive-skills.d.ts.map +1 -0
- package/dist/aria-connector/src/connectors/cognitive-skills.js +47 -0
- package/dist/aria-connector/src/connectors/cognitive-skills.js.map +1 -0
- package/dist/aria-connector/src/connectors/opencode.d.ts.map +1 -1
- package/dist/aria-connector/src/connectors/opencode.js +90 -4
- package/dist/aria-connector/src/connectors/opencode.js.map +1 -1
- package/dist/aria-connector/src/connectors/repo-git-hooks.d.ts +3 -0
- package/dist/aria-connector/src/connectors/repo-git-hooks.d.ts.map +1 -0
- package/dist/aria-connector/src/connectors/repo-git-hooks.js +87 -0
- package/dist/aria-connector/src/connectors/repo-git-hooks.js.map +1 -0
- package/dist/aria-connector/src/connectors/repo-guard.d.ts +19 -0
- package/dist/aria-connector/src/connectors/repo-guard.d.ts.map +1 -0
- package/dist/aria-connector/src/connectors/repo-guard.js +509 -0
- package/dist/aria-connector/src/connectors/repo-guard.js.map +1 -0
- package/dist/aria-connector/src/connectors/runtime.d.ts +2 -0
- package/dist/aria-connector/src/connectors/runtime.d.ts.map +1 -0
- package/dist/aria-connector/src/connectors/runtime.js +330 -0
- package/dist/aria-connector/src/connectors/runtime.js.map +1 -0
- package/dist/aria-connector/src/connectors/shell.d.ts.map +1 -1
- package/dist/aria-connector/src/connectors/shell.js +78 -13
- package/dist/aria-connector/src/connectors/shell.js.map +1 -1
- package/dist/aria-connector/src/connectors/syncd.d.ts +27 -0
- package/dist/aria-connector/src/connectors/syncd.d.ts.map +1 -0
- package/dist/aria-connector/src/connectors/syncd.js +405 -0
- package/dist/aria-connector/src/connectors/syncd.js.map +1 -0
- package/dist/aria-connector/src/decisions.d.ts +207 -0
- package/dist/aria-connector/src/decisions.d.ts.map +1 -0
- package/dist/aria-connector/src/decisions.js +291 -0
- package/dist/aria-connector/src/decisions.js.map +1 -0
- package/dist/aria-connector/src/garden-control-plane.d.ts.map +1 -1
- package/dist/aria-connector/src/garden-control-plane.js +74 -17
- package/dist/aria-connector/src/garden-control-plane.js.map +1 -1
- package/dist/aria-connector/src/github-connect.d.ts +18 -0
- package/dist/aria-connector/src/github-connect.d.ts.map +1 -0
- package/dist/aria-connector/src/github-connect.js +117 -0
- package/dist/aria-connector/src/github-connect.js.map +1 -0
- package/dist/aria-connector/src/harness-client.d.ts +15 -0
- package/dist/aria-connector/src/harness-client.d.ts.map +1 -1
- package/dist/aria-connector/src/harness-client.js +106 -3
- package/dist/aria-connector/src/harness-client.js.map +1 -1
- package/dist/aria-connector/src/hive-client.d.ts +30 -0
- package/dist/aria-connector/src/hive-client.d.ts.map +1 -1
- package/dist/aria-connector/src/hive-client.js +124 -5
- package/dist/aria-connector/src/hive-client.js.map +1 -1
- package/dist/aria-connector/src/index.d.ts +13 -2
- package/dist/aria-connector/src/index.d.ts.map +1 -1
- package/dist/aria-connector/src/index.js +10 -1
- package/dist/aria-connector/src/index.js.map +1 -1
- package/dist/aria-connector/src/lib/aristotle-noor-wire.d.ts +102 -0
- package/dist/aria-connector/src/lib/aristotle-noor-wire.d.ts.map +1 -0
- package/dist/aria-connector/src/lib/aristotle-noor-wire.js +231 -0
- package/dist/aria-connector/src/lib/aristotle-noor-wire.js.map +1 -0
- package/dist/aria-connector/src/providers/types.d.ts +5 -0
- package/dist/aria-connector/src/providers/types.d.ts.map +1 -1
- package/dist/aria-connector/src/runtime-proof.d.ts +45 -0
- package/dist/aria-connector/src/runtime-proof.d.ts.map +1 -0
- package/dist/aria-connector/src/runtime-proof.js +340 -0
- package/dist/aria-connector/src/runtime-proof.js.map +1 -0
- package/dist/aria-connector/src/self-update.d.ts +2 -1
- package/dist/aria-connector/src/self-update.d.ts.map +1 -1
- package/dist/aria-connector/src/self-update.js +84 -8
- package/dist/aria-connector/src/self-update.js.map +1 -1
- package/dist/aria-connector/src/setup-wizard.d.ts.map +1 -1
- package/dist/aria-connector/src/setup-wizard.js +34 -2
- package/dist/aria-connector/src/setup-wizard.js.map +1 -1
- package/dist/assets/hooks/aria-agent-handoff.mjs +224 -0
- package/dist/assets/hooks/aria-agent-ledger-merge.mjs +164 -0
- package/dist/assets/hooks/aria-architect-fallback.mjs +267 -0
- package/dist/assets/hooks/aria-cognition-substrate-binding.mjs +668 -0
- package/dist/assets/hooks/aria-discovery-record.mjs +101 -0
- package/dist/assets/hooks/aria-harness-via-sdk.mjs +412 -0
- package/dist/assets/hooks/aria-import-resolution-gate.mjs +330 -0
- package/dist/assets/hooks/aria-outcome-record.mjs +84 -0
- package/dist/assets/hooks/aria-pre-emit-dryrun.mjs +294 -0
- package/dist/assets/hooks/aria-pre-text-gate.mjs +112 -0
- package/dist/assets/hooks/aria-pre-tool-gate.mjs +2133 -0
- package/dist/assets/hooks/aria-preprompt-consult.mjs +438 -0
- package/dist/assets/hooks/aria-preturn-memory-gate.mjs +570 -0
- package/dist/assets/hooks/aria-repo-doctrine-gate.mjs +397 -0
- package/dist/assets/hooks/aria-stop-gate.mjs +1551 -0
- package/dist/assets/hooks/aria-trigger-autolearn.mjs +229 -0
- package/dist/assets/hooks/aria-userprompt-abandon-detect.mjs +192 -0
- package/dist/assets/hooks/doctrine_trigger_map.json +479 -0
- package/dist/assets/hooks/lib/canonical-lenses.mjs +64 -0
- package/dist/assets/hooks/lib/gate-audit.mjs +43 -0
- package/dist/assets/hooks/test-aria-preturn-memory-gate.mjs +245 -0
- package/dist/assets/hooks/test-tier-lens-labeling.mjs +399 -0
- package/dist/assets/opencode-plugins/harness-context/index.js +60 -0
- package/dist/assets/opencode-plugins/harness-context/inject-context.mjs +179 -0
- package/dist/assets/opencode-plugins/harness-context/package.json +9 -0
- package/dist/assets/opencode-plugins/harness-gate/index.js +248 -0
- package/dist/assets/opencode-plugins/harness-outcome/index.js +129 -0
- package/dist/assets/opencode-plugins/harness-role/index.js +77 -0
- package/dist/assets/opencode-plugins/harness-role/package.json +9 -0
- package/dist/assets/opencode-plugins/harness-stop/index.js +241 -0
- package/dist/runtime/discipline/CLAUDE.md +339 -0
- package/dist/runtime/discipline/skills/aria-cognition/aria-essence/SKILL.md +63 -0
- package/dist/runtime/discipline/skills/aria-cognition/aria-essence/references/domain-matrix.md +80 -0
- package/dist/runtime/discipline/skills/aria-cognition/aria-essence/references/evolution-loop.md +30 -0
- package/dist/runtime/discipline/skills/aria-cognition/aria-essence/references/readable-cognition.md +27 -0
- package/dist/runtime/discipline/skills/aria-cognition/aria-forge-guardrails/SKILL.md +35 -0
- package/dist/runtime/discipline/skills/aria-cognition/aria-forge-guardrails/references/checklist.md +31 -0
- package/dist/runtime/discipline/skills/aria-cognition/aria-repo-doctrine/SKILL.md +39 -0
- package/dist/runtime/discipline/skills/aria-cognition/forge-quality-rules/SKILL.md +43 -0
- package/dist/runtime/discipline/skills/aria-cognition/ghazali-8lens/SKILL.md +38 -0
- package/dist/runtime/discipline/skills/aria-cognition/istiqra-induction/SKILL.md +26 -0
- package/dist/runtime/discipline/skills/aria-cognition/ladunni-22/SKILL.md +35 -0
- package/dist/runtime/discipline/skills/aria-cognition/mizan/SKILL.md +72 -0
- package/dist/runtime/discipline/skills/aria-cognition/nadia/SKILL.md +38 -0
- package/dist/runtime/discipline/skills/aria-cognition/nadia-psi/SKILL.md +38 -0
- package/dist/runtime/discipline/skills/aria-cognition/predictor/SKILL.md +25 -0
- package/dist/runtime/discipline/skills/aria-cognition/qiyas-analogy/SKILL.md +26 -0
- package/dist/runtime/discipline/skills/aria-cognition/soul-domains/SKILL.md +25 -0
- package/dist/runtime/discipline/skills/aria-harness/aria-aristotle-intra-phase/SKILL.md +81 -0
- package/dist/runtime/discipline/skills/aria-harness/aria-aristotle-post-phase/SKILL.md +98 -0
- package/dist/runtime/discipline/skills/aria-harness/aria-aristotle-pre-phase/SKILL.md +99 -0
- package/dist/runtime/discipline/skills/aria-harness/aria-harness-deploy/SKILL.md +127 -0
- package/dist/runtime/discipline/skills/aria-harness/aria-harness-no-stripping/SKILL.md +117 -0
- package/dist/runtime/discipline/skills/aria-harness/aria-harness-onboarding/SKILL.md +112 -0
- package/dist/runtime/discipline/skills/aria-harness/aria-harness-output-discipline/SKILL.md +102 -0
- package/dist/runtime/discipline/skills/aria-harness/aria-harness-substrate-binding/SKILL.md +121 -0
- package/dist/runtime/doctor.mjs +23 -0
- package/dist/runtime/local-phase.mjs +650 -0
- package/dist/runtime/manifest.json +15 -0
- package/dist/runtime/mizan-scheduler.mjs +331 -0
- package/dist/runtime/package.json +6 -0
- package/dist/runtime/provider-proxy.mjs +594 -0
- package/dist/runtime/sdk/BUNDLED.json +5 -0
- package/dist/runtime/sdk/index.d.ts +477 -0
- package/dist/runtime/sdk/index.js +1469 -0
- package/dist/runtime/sdk/index.js.map +1 -0
- package/dist/runtime/sdk/package.json +8 -0
- package/dist/runtime/sdk/runWithCognition.d.ts +77 -0
- package/dist/runtime/sdk/runWithCognition.js +157 -0
- package/dist/runtime/sdk/runWithCognition.js.map +1 -0
- package/dist/runtime/service.mjs +3058 -0
- package/dist/runtime/vendor/aria-gate-runtime/index.d.ts +53 -0
- package/dist/runtime/vendor/aria-gate-runtime/index.d.ts.map +1 -0
- package/dist/runtime/vendor/aria-gate-runtime/index.js +292 -0
- package/dist/runtime/vendor/aria-gate-runtime/index.js.map +1 -0
- package/dist/runtime/vendor/aria-gate-runtime/package.json +6 -0
- package/dist/sdk/BUNDLED.json +2 -2
- package/dist/sdk/index.d.ts +283 -0
- package/dist/sdk/index.js +622 -85
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runWithCognition.d.ts +77 -0
- package/dist/sdk/runWithCognition.js +157 -0
- package/dist/sdk/runWithCognition.js.map +1 -0
- package/hooks/aria-agent-handoff.mjs +11 -1
- package/hooks/aria-architect-fallback.mjs +109 -40
- package/hooks/aria-cognition-substrate-binding.mjs +668 -0
- package/hooks/aria-harness-via-sdk.mjs +34 -21
- package/hooks/aria-import-resolution-gate.mjs +330 -0
- package/hooks/aria-outcome-record.mjs +5 -1
- package/hooks/aria-pre-emit-dryrun.mjs +294 -0
- package/hooks/aria-pre-tool-gate.mjs +828 -41
- package/hooks/aria-preprompt-consult.mjs +113 -13
- package/hooks/aria-preturn-memory-gate.mjs +298 -6
- package/hooks/aria-repo-doctrine-gate.mjs +397 -0
- package/hooks/aria-stop-gate.mjs +739 -76
- package/hooks/aria-userprompt-abandon-detect.mjs +5 -1
- package/hooks/doctrine_trigger_map.json +209 -15
- package/hooks/lib/canonical-lenses.mjs +64 -0
- package/hooks/lib/gate-audit.mjs +43 -0
- package/opencode-plugins/harness-context/index.js +1 -1
- package/opencode-plugins/harness-context/inject-context.mjs +82 -23
- package/opencode-plugins/harness-gate/index.js +248 -0
- package/opencode-plugins/harness-outcome/index.js +129 -0
- package/opencode-plugins/harness-stop/index.js +241 -0
- package/package.json +9 -3
- package/runtime-src/doctor.mjs +23 -0
- package/runtime-src/local-phase.mjs +650 -0
- package/runtime-src/mizan-scheduler.mjs +331 -0
- package/runtime-src/provider-proxy.mjs +594 -0
- package/runtime-src/service.mjs +3058 -0
- package/scripts/bundle-sdk.mjs +317 -0
- package/scripts/install-client.sh +176 -0
- package/scripts/publish-all.sh +344 -0
- package/scripts/publish-docker.sh +27 -0
- package/scripts/validate-hook-contracts.mjs +54 -0
- package/scripts/validate-skill-prompts.mjs +95 -0
- package/skills/aria-cognition/aria-essence/SKILL.md +63 -0
- package/skills/aria-cognition/aria-essence/references/domain-matrix.md +80 -0
- package/skills/aria-cognition/aria-essence/references/evolution-loop.md +30 -0
- package/skills/aria-cognition/aria-essence/references/readable-cognition.md +27 -0
- package/skills/aria-cognition/aria-forge-guardrails/SKILL.md +35 -0
- package/skills/aria-cognition/aria-forge-guardrails/references/checklist.md +31 -0
- package/skills/aria-cognition/aria-repo-doctrine/SKILL.md +39 -0
- package/skills/aria-cognition/forge-quality-rules/SKILL.md +43 -0
- package/skills/aria-cognition/ghazali-8lens/SKILL.md +38 -0
- package/skills/aria-cognition/istiqra-induction/SKILL.md +26 -0
- package/skills/aria-cognition/ladunni-22/SKILL.md +35 -0
- package/skills/aria-cognition/mizan/SKILL.md +72 -0
- package/skills/aria-cognition/nadia/SKILL.md +38 -0
- package/skills/aria-cognition/nadia-psi/SKILL.md +38 -0
- package/skills/aria-cognition/predictor/SKILL.md +25 -0
- package/skills/aria-cognition/qiyas-analogy/SKILL.md +26 -0
- package/skills/aria-cognition/soul-domains/SKILL.md +25 -0
- package/src/auth-commands.ts +111 -45
- package/src/chat.ts +174 -13
- package/src/codebase-scanner.ts +4 -0
- package/src/config.ts +15 -0
- package/src/connectors/claude-code.ts +79 -25
- package/src/connectors/codebase-awareness.ts +408 -0
- package/src/connectors/codex.ts +274 -0
- package/src/connectors/cognitive-skills.ts +51 -0
- package/src/connectors/opencode.ts +93 -4
- package/src/connectors/repo-git-hooks.ts +86 -0
- package/src/connectors/repo-guard.ts +589 -0
- package/src/connectors/runtime.ts +374 -0
- package/src/connectors/shell.ts +83 -14
- package/src/connectors/syncd.ts +488 -0
- package/src/decisions.ts +469 -0
- package/src/garden-control-plane.ts +101 -26
- package/src/github-connect.ts +143 -0
- package/src/harness-client.ts +128 -3
- package/src/hive-client.ts +165 -5
- package/src/index.ts +41 -2
- package/src/lib/aristotle-noor-wire.ts +310 -0
- package/src/providers/types.ts +6 -0
- package/src/runtime-proof.ts +392 -0
- package/src/self-update.ts +89 -8
- package/src/setup-wizard.ts +37 -2
|
@@ -137,7 +137,11 @@ if (!isAbandonment) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
// Abandonment detected — write session_audit row + emit warning context.
|
|
140
|
-
const harnessUrl =
|
|
140
|
+
const harnessUrl =
|
|
141
|
+
process.env.ARIA_HIVE_RUNTIME_URL ||
|
|
142
|
+
process.env.ARIA_HARNESS_BASE_URL ||
|
|
143
|
+
process.env.ARIA_HARNESS_URL ||
|
|
144
|
+
'https://harness.ariasos.com';
|
|
141
145
|
const harnessToken = process.env.ARIA_HARNESS_TOKEN || '';
|
|
142
146
|
|
|
143
147
|
if (harnessToken) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_meta": {
|
|
3
|
-
"purpose": "Static lookup: trigger phrase
|
|
3
|
+
"purpose": "Static lookup: trigger phrase \u2192 counter-doctrine memory + teaching. Pre-emit fast path for stop-gate enforcement. When Claude's draft contains a trigger, hook injects the matching [REQUIRED_DOCTRINE] block referencing the named memory file and forces proof of doctrine-alignment before emit.",
|
|
4
4
|
"design_origin": "Aria consult 2026-04-27 ship-tonight design item 1. Pairs with feedback_convenience_seeking_root_cause.md.",
|
|
5
5
|
"extension_protocol": "When Hamza corrects Claude with a phrase not in this map, add the trigger here pointing at the memory file the correction creates or invokes. Auto-learning queue.",
|
|
6
6
|
"format": {
|
|
7
7
|
"trigger": "lowercase substring or regex pattern Claude must avoid using under convenience pressure",
|
|
8
8
|
"memory": "filename in ~/.claude/projects/-home-hamzaibrahim1/memory/ that holds the canonical counter-doctrine",
|
|
9
|
-
"teaching": "one-line load-bearing teaching from the memory
|
|
9
|
+
"teaching": "one-line load-bearing teaching from the memory \u2014 the rule the trigger violates",
|
|
10
10
|
"counter_action": "what Claude should do INSTEAD of the convenience pattern"
|
|
11
11
|
}
|
|
12
12
|
},
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"counter_action": "Surface the failure. Caller decides whether to proceed. No catch + empty-default."
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
"trigger": "
|
|
33
|
+
"trigger": "\\bpreferred\\b",
|
|
34
34
|
"memory": "feedback_pretoolgate_covers_all_action_tools.md",
|
|
35
35
|
"teaching": "Gate cognition is REQUIRED, not preferred. v3 doctrine: no exceptions.",
|
|
36
36
|
"counter_action": "Use REQUIRED wording. Two equivalent forms (inline OR cognition block) but neither is preferred over the other; both equally required."
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
{
|
|
51
51
|
"trigger": "should be fine|should work",
|
|
52
52
|
"memory": "feedback_doctrine_first.md",
|
|
53
|
-
"teaching": "Don't assume
|
|
53
|
+
"teaching": "Don't assume \u2014 verify. 'Should work' is the speculation pattern that masks unverified claims.",
|
|
54
54
|
"counter_action": "Run the read-only check that proves it works (file read, kubectl get, curl probe). Replace 'should' with verified evidence."
|
|
55
55
|
},
|
|
56
56
|
{
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
"counter_action": "Diagnose root cause + fix + verify. Never propose 'come back to it later' as the resolution."
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
"trigger": "skeleton|stub",
|
|
69
|
+
"trigger": "\\b(?:skeleton|stub)\\b",
|
|
70
70
|
"memory": "feedback_no_demos.md",
|
|
71
71
|
"teaching": "Skeleton is the hedge framing. Real implementation only.",
|
|
72
72
|
"counter_action": "Ship complete or explicitly mark incomplete + create task. Never call partial work 'skeleton' to dodge accountability."
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
|
-
"trigger": "
|
|
75
|
+
"trigger": "\\bdemo\\b",
|
|
76
76
|
"memory": "feedback_no_demos.md",
|
|
77
77
|
"teaching": "No demos. Every spawn is production work at full quality bar.",
|
|
78
78
|
"counter_action": "Ship production. If it can't ship, name what's missing concretely."
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
{
|
|
105
105
|
"trigger": "in production",
|
|
106
106
|
"memory": "feedback_doctrine_first.md",
|
|
107
|
-
"teaching": "'In production' is often speculative
|
|
107
|
+
"teaching": "'In production' is often speculative \u2014 assumed behavior, not verified.",
|
|
108
108
|
"counter_action": "Verify against live cluster state OR codebase config. Substrate hierarchy: user statement > codebase > training data."
|
|
109
109
|
},
|
|
110
110
|
{
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"trigger": "want me to|should i",
|
|
118
118
|
"memory": "feedback_use_harness_to_architect.md",
|
|
119
119
|
"teaching": "Asking 'should I' AFTER directive given is the deferral pattern.",
|
|
120
|
-
"counter_action": "Aria architects via harness consult, Claude integrates. If unclear, consult Aria
|
|
120
|
+
"counter_action": "Aria architects via harness consult, Claude integrates. If unclear, consult Aria \u2014 don't bounce decision back to Hamza."
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
"trigger": "make a new|create a fresh",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"counter_action": "Search the codebase for existing canonical primitive first. Reuse before recreate."
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
|
-
"trigger": "shadow|proxy|wrapper",
|
|
129
|
+
"trigger": "\\b(?:shadow|proxy|wrapper)\\b",
|
|
130
130
|
"memory": "feedback_aria_already_has_fleet_use_existing_substrate.md",
|
|
131
131
|
"teaching": "Shadow / proxy / wrapper that bypasses canonical = invented complexity.",
|
|
132
132
|
"counter_action": "Use the canonical surface. If it must be wrapped, document why and reference the canonical it wraps."
|
|
@@ -141,10 +141,10 @@
|
|
|
141
141
|
"trigger": "fail loud|crash on missing",
|
|
142
142
|
"memory": "feedback_no_graceful_degradation.md",
|
|
143
143
|
"teaching": "Fail-loud-no-fallback is the OPPOSITE bypass. Real shape = retry + backoff + heal.",
|
|
144
|
-
"counter_action": "Detect failure
|
|
144
|
+
"counter_action": "Detect failure \u2192 retry with backoff \u2192 on persistent failure invoke selfHealV2 to actively repair \u2192 only escalate to human if heal fails."
|
|
145
145
|
},
|
|
146
146
|
{
|
|
147
|
-
"trigger": "patch|hotfix|band.?aid",
|
|
147
|
+
"trigger": "\\b(?:patch|hotfix|band.?aid)\\b",
|
|
148
148
|
"memory": "feedback_gates_enforce_form_not_substance.md",
|
|
149
149
|
"teaching": "Patch / hotfix is form-fix. Root-cause fix is the doctrine.",
|
|
150
150
|
"counter_action": "Diagnose substance. If reflex is bypass, ask if root-cause fix is possible. Patch only when explicitly authorized as temporary with tracked follow-up."
|
|
@@ -170,8 +170,8 @@
|
|
|
170
170
|
{
|
|
171
171
|
"trigger": "i think|i guess|i assume",
|
|
172
172
|
"memory": "feedback_doctrine_first.md",
|
|
173
|
-
"teaching": "Don't assume. axiom_runtime: admit_ignorance
|
|
174
|
-
"counter_action": "State 'I don't know
|
|
173
|
+
"teaching": "Don't assume. axiom_runtime: admit_ignorance \u2192 verify before action.",
|
|
174
|
+
"counter_action": "State 'I don't know \u2014 verifying' + run a read-only check (file read, kubectl get, codebase grep) + then act on facts."
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
"trigger": "preferred over|optional|fallback layer",
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
"trigger": "we should also (fix|address|handle|update|deal with)",
|
|
220
220
|
"memory": "feedback_no_flag_without_fix.md",
|
|
221
221
|
"teaching": "'We should also fix' tells the user about a problem you found while volunteering them to fix it.",
|
|
222
|
-
"counter_action": "If the fix is in your scope, fix it now. If it's truly out of scope, create the task
|
|
222
|
+
"counter_action": "If the fix is in your scope, fix it now. If it's truly out of scope, create the task \u2014 don't hand it back as a verbal note."
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
"trigger": "let me (note|flag)|(?<!please )leaving (this )?for follow.?up|out of scope here",
|
|
@@ -255,7 +255,7 @@
|
|
|
255
255
|
"trigger": "ignore[^.]{0,40}(?:not.?found|missing|absent|undefined)|exclude[^.]{0,40}(?:not.?found|missing|absent)",
|
|
256
256
|
"memory": "feedback_workaround_vs_path_fix.md",
|
|
257
257
|
"teaching": "Ignoring a not-found file/path is fixing the symptom; the cause is the file isn't being produced where expected.",
|
|
258
|
-
"counter_action": "Trace why the file is missing
|
|
258
|
+
"counter_action": "Trace why the file is missing \u2014 which step was supposed to produce it? Fix that step, not the consumer's tolerance for absence."
|
|
259
259
|
},
|
|
260
260
|
{
|
|
261
261
|
"trigger": "next.?session|follow.?up.?(?:task|later)|defer(?:red|ring)? to (?:next|later|future)",
|
|
@@ -280,6 +280,200 @@
|
|
|
280
280
|
"memory": "feedback_apply_lenses_dont_perform_them.md",
|
|
281
281
|
"teaching": "'Trust me' is not evidence. Substance is verifiable; ceremony is reassurance.",
|
|
282
282
|
"counter_action": "Show the verification: tool output, file diff, command result, log line. Never substitute confidence for proof."
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"trigger": "i assumed",
|
|
286
|
+
"memory": "feedback_no_assumption_without_verification.md",
|
|
287
|
+
"teaching": "Assumption stated as fact is the behavioral-drift form of speculation. Every behavioral fix must cite a verifiedAgainst source.",
|
|
288
|
+
"counter_action": "Replace 'I assumed' with a verified citation: 'Verified against <file:line>' or 'Verified via <command output>'. If unverified, run the read-only probe before asserting."
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"trigger": "should work",
|
|
292
|
+
"memory": "feedback_no_assumption_without_verification.md",
|
|
293
|
+
"teaching": "'Should work' is unverified projection. Behavioral claims require verifiedAgainst evidence.",
|
|
294
|
+
"counter_action": "Run the actual probe (curl, kubectl get, file read, test invocation). Replace 'should work' with 'verified against <surface>' showing the observed behavior."
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"trigger": "based on existing pattern",
|
|
298
|
+
"memory": "feedback_no_assumption_without_verification.md",
|
|
299
|
+
"teaching": "Pattern-extrapolation without source-of-truth verification is assumption. Existing patterns drift; the canonical surface is authoritative.",
|
|
300
|
+
"counter_action": "Cite the specific file:line of the pattern AND verify it still matches current behavior. verifiedAgainst must name the inspected source, not 'pattern I remember'."
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"trigger": "mirroring [a-z-]+",
|
|
304
|
+
"memory": "feedback_no_assumption_without_verification.md",
|
|
305
|
+
"teaching": "'Mirroring X' assumes X is correct AND that the mirror is structurally faithful. Both are unverified claims.",
|
|
306
|
+
"counter_action": "Read the source you're mirroring (cite file:line). Verify the mirror's behavior matches by running the equivalent probe on both. Document verifiedAgainst with both sources."
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"trigger": "similar to [a-z-]+",
|
|
310
|
+
"memory": "feedback_no_assumption_without_verification.md",
|
|
311
|
+
"teaching": "'Similar to X' is the soft-mirror pattern \u2014 even more dangerous because the asserted similarity is itself unverified.",
|
|
312
|
+
"counter_action": "Either it IS the same (cite identical surfaces) or it's different (name the differences). 'Similar' is a hedge that hides the gap."
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"trigger": "presumably",
|
|
316
|
+
"memory": "feedback_no_assumption_without_verification.md",
|
|
317
|
+
"teaching": "'Presumably' is the explicit speculation marker. Presumption without verification fails the doctrine.",
|
|
318
|
+
"counter_action": "Replace 'presumably' with the read-only probe result. If the probe can't be run, say 'unverified \u2014 verifying' and then verify before asserting."
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"trigger": "likely the same",
|
|
322
|
+
"memory": "feedback_no_assumption_without_verification.md",
|
|
323
|
+
"teaching": "'Likely the same' is probability-as-evidence. Either verify equality or admit divergence.",
|
|
324
|
+
"counter_action": "Diff the two surfaces. If identical, say 'verified identical against <surface>'. If different, name the deltas. 'Likely' has no place in behavioral claims."
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"trigger": "probably correct",
|
|
328
|
+
"memory": "feedback_no_assumption_without_verification.md",
|
|
329
|
+
"teaching": "'Probably correct' is unverified-confidence. Behavioral correctness is binary against a verifiedAgainst source.",
|
|
330
|
+
"counter_action": "Run the validation that proves correctness (test, probe, read). Replace 'probably' with 'verified against <test output / file:line / command result>'."
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"trigger": "i think it'?s",
|
|
334
|
+
"memory": "feedback_no_assumption_without_verification.md",
|
|
335
|
+
"teaching": "'I think it's' is internal speculation surfaced as claim. Thoughts aren't evidence.",
|
|
336
|
+
"counter_action": "State 'I don't know \u2014 verifying' and run the probe. Then assert with verifiedAgainst citation, not internal belief."
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"trigger": "if memory serves",
|
|
340
|
+
"memory": "feedback_no_assumption_without_verification.md",
|
|
341
|
+
"teaching": "Memory is stale. Memories are point-in-time observations, not live state. 'If memory serves' is the explicit stale-cite admission.",
|
|
342
|
+
"counter_action": "Re-verify against current state. Read the file, query the cluster, run the command. verifiedAgainst names today's evidence, not yesterday's recollection."
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"trigger": "no admission policy|policy is absent|policy not found|no policy in the cluster|no policy exists for|admission policy missing",
|
|
346
|
+
"memory": "feedback_admission_policy_verification.md",
|
|
347
|
+
"teaching": "Verify admission policies via kubectl get validatingadmissionpolicy BEFORE claiming absence. Cluster has live policies that do not appear in repo grep. Absence-without-verification is a doctrine violation.",
|
|
348
|
+
"counter_action": "Run kubectl get validatingadmissionpolicy plus find . -name '*admission-policy*' -type f. Both must return empty before absence claim. If absent, author the policy file from an existing cluster resource template via kubectl get -o yaml, kubectl apply, then proceed via the canonical deploy path."
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"trigger": "use the override|skip the gate|emergency flag|temporarily bypass|use the env disable|force through|DEPLOY_ALLOW_NO_ADMISSION_POLICY|ARIA_BINDING_ENABLED=false|--no-verify|--force",
|
|
352
|
+
"memory": "feedback_gap_discovery_hardens_doctrine.md",
|
|
353
|
+
"teaching": "When a gate refuses an action, the response is to harden doctrine, not to bypass. Override usage requires explicit owner authorization in-session plus audit log plus follow-up TaskCreate to close the gap.",
|
|
354
|
+
"counter_action": "Stop the bypass attempt. Write a memory entry for the gap class, append to MEMORY.md index, add the drift trigger here in doctrine_trigger_map.json, then proceed via the normal path. If override is genuinely required, request explicit authorization in this turn before invoking and create a follow-up task to close the gap."
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"trigger": "deploy-service\\.sh|apply-aria-organism\\.sh|kubectl apply -f|kubectl set image|docker push|trivial deploy|just a config bump|fast path deploy|skip the verify|deploy without verify|hospital-service\\.yaml",
|
|
358
|
+
"memory": "feedback_deploy_requires_verify_cognition.md",
|
|
359
|
+
"teaching": "Every deploy requires a <verify> block citing artifact (commit, files, TS check, image digest) AND a <cognition> block with 8 substrate-anchored lenses BEFORE invocation. Tonight's consciousness.ts crash proved the cost of skipping this gate.",
|
|
360
|
+
"counter_action": "Stop and classify the deploy shape first. Pattern A baked-image services must use bash scripts/deploy-service.sh <service>, which handles Hive deploy lock and inflight broadcast, admission-policy allowlist, hospital canonical env, and workload rollout. Pattern B build-in-cluster services must prove build-in-cluster is present, then use kubectl rollout restart only. scripts/apply-aria-organism.sh is manifest wiring, not a substitute for an aria-soul image deploy, and direct kubectl apply of apps/hospital-service/k8s/hospital-service.yaml must never be used as a soul deploy shortcut because it can reintroduce a stale hospital canonical pin. In both cases emit <verify> with commit/files, tsc or build evidence, admission policy, and rollback; emit <cognition> with 8 anchored lenses; emit <expected> with a measurable predicate; and do not proceed if another session already holds the Hive deploy lock for /deployments/<namespace>/<service>."
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"trigger": "another session rolling out|someone else is deploying|deploy in flight|rollout in flight|concurrent deploy|another deploy is running",
|
|
364
|
+
"memory": "feedback_deploy_requires_verify_cognition.md",
|
|
365
|
+
"teaching": "Concurrent deploys are shared-infra mutations, not harmless overlap. If one session is already rolling a service, the next session must yield to the canonical deploy lock rather than race hospital and admission policy state.",
|
|
366
|
+
"counter_action": "Verify the target service and deploy pattern first, then check the Hive deploy lane for /deployments/<namespace>/<service>. If a deploy is already in flight, do not start another rollout on that service. Wait, coordinate, or change scope."
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"trigger_id": "dalio_expected_missing",
|
|
370
|
+
"trigger": "(?:plan|action|deploy|edit|write|build|ship|run|invoke).{0,40}(?:without|sans|no)\\s+(?:expected|measurable|outcome|predicate)",
|
|
371
|
+
"rx": "(?:plan|action|deploy|edit|write|build|ship|run|invoke).{0,40}(?:without|sans|no)\\s+(?:expected|measurable|outcome|predicate)",
|
|
372
|
+
"doctrine": "memory:feedback_dalio_expected_required.md",
|
|
373
|
+
"memory": "feedback_dalio_expected_required.md",
|
|
374
|
+
"severity": "block",
|
|
375
|
+
"teaching": "Every plan/action must declare a measurable expected outcome predicate (numeric/boolean/state-string) BEFORE the gate approves. No action without <expected> block.",
|
|
376
|
+
"counter_action": "Re-emit your plan with a <expected> block: { predicate: string, measurable_type: 'numeric'|'boolean'|'state_string', threshold: optional }. Gate will not approve until a verifiable predicate is present.",
|
|
377
|
+
"message": "Action proposed without measurable expected outcome. Per doctrine:dalio_expected_required, every plan must declare a measurable predicate (numeric/boolean/state-string) BEFORE the gate approves. Re-emit with <expected> block."
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"trigger_id": "dalio_expected_qualitative",
|
|
381
|
+
"trigger": "expected\\s*:.{0,200}\\b(better|improved|more\\s+robust|cleaner|nicer|should\\s+work|hopefully|more\\s+reliable|enhanced)\\b",
|
|
382
|
+
"rx": "expected\\s*:.{0,200}\\b(better|improved|more\\s+robust|cleaner|nicer|should\\s+work|hopefully|more\\s+reliable|enhanced)\\b",
|
|
383
|
+
"doctrine": "memory:feedback_dalio_expected_required.md",
|
|
384
|
+
"memory": "feedback_dalio_expected_required.md",
|
|
385
|
+
"severity": "block",
|
|
386
|
+
"teaching": "Expected-outcome predicate must be numeric/boolean/state-string \u2014 qualitative adjectives ('better', 'improved', 'should work') are not measurable and cannot be evaluated post-gate.",
|
|
387
|
+
"counter_action": "Replace qualitative expected with a measurable predicate. Example: instead of 'expected: better performance', use 'expected: { predicate: \"p95 latency < 200ms\", measurable_type: \"numeric\", threshold: 200 }'.",
|
|
388
|
+
"message": "Expected-outcome predicate is qualitative ('better'/'improved'/'should work') \u2014 not measurable. Replace with numeric/boolean/state-string predicate the post-gate can evaluate."
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"trigger_id": "dalio_actual_unsubstrate",
|
|
392
|
+
"trigger": "immediate_actual\\s*:[^\\n]{0,200}$",
|
|
393
|
+
"rx": "immediate_actual\\s*:[^\\n]{0,200}$",
|
|
394
|
+
"doctrine": "memory:feedback_full_harness_binding_must_be_structural.md",
|
|
395
|
+
"memory": "feedback_full_harness_binding_must_be_structural.md",
|
|
396
|
+
"severity": "warn",
|
|
397
|
+
"teaching": "immediate_actual must cite a tool output, file:line, or command result the post-gate can verify. Bare prose is not substrate-anchored evidence.",
|
|
398
|
+
"counter_action": "Append a verifiedAgainst citation to your immediate_actual field. Format: 'immediate_actual: <observation> [verifiedAgainst: <tool output | file:line | command result>]'.",
|
|
399
|
+
"message": "immediate_actual lacks substrate citation \u2014 cite a tool output, file:line, or command-result the post-gate can verify."
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"trigger_id": "hive_session_concurrent_edit",
|
|
403
|
+
"trigger": "(?:editing|modifying|writing).{0,50}(?:same|already|conflict).{0,50}(?:file|path|repo|branch)",
|
|
404
|
+
"rx": "(?:editing|modifying|writing).{0,50}(?:same|already|conflict).{0,50}(?:file|path|repo|branch)",
|
|
405
|
+
"doctrine": "memory:feedback_hive_session_coordination.md",
|
|
406
|
+
"memory": "feedback_hive_session_coordination.md",
|
|
407
|
+
"severity": "block",
|
|
408
|
+
"teaching": "Multiple sessions on same path without hive lock = silent overwrite. Claim hive_session_lock + post hive_session_message BEFORE editing concurrently.",
|
|
409
|
+
"counter_action": "Call sdk.claimSessionLock({ filePath, sessionId, ttlMinutes }) to acquire the lock. Post sdk.postSessionMessage to the other session announcing your intent. Only edit after the lock is granted. Release with sdk.releaseSessionLock(lockId) when done.",
|
|
410
|
+
"message": "Multiple sessions detected on same path. Per doctrine:hive_session_coordination, claim a hive_session_lock + post hive_session_message before editing concurrently."
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
"trigger_id": "non_blocking_error_excuse",
|
|
414
|
+
"trigger": "using non-blocking framing as a reason to not resolve an error",
|
|
415
|
+
"rx": "\\b(non[-_\\s]?blocking|non[-_\\s]?fatal|best[-_\\s]?effort|fire[-_\\s]?and[-_\\s]?forget|fail[-_\\s]?open|soft[-_\\s]?fail|logged[-_\\s]?and[-_\\s]?continued|silent[-_\\s]?pass|graceful[-_\\s]?degradation|skipped\\s+this\\s+iteration|warn\\s+and\\s+proceed|ignore\\s+for\\s+now|wont\\s+crash|doesnt\\s+break\\s+the\\s+flow|user\\s+wont\\s+notice)\\b",
|
|
416
|
+
"doctrine": "memory:feedback_non_blocking_errors_unacceptable.md",
|
|
417
|
+
"memory": "feedback_non_blocking_errors_unacceptable.md",
|
|
418
|
+
"severity": "block",
|
|
419
|
+
"teaching": "Non-blocking does not mean acceptable. Every error logs LOUD + surfaces to next-turn substrate + ledgers + resolves.",
|
|
420
|
+
"counter_action": "Replace the non-blocking framing with: log LOUD via console.error, surface via discovery ledger entry, route to either inline fix or TaskCreate with full context.",
|
|
421
|
+
"message": "Non-blocking error framing detected. Per Hamza directive 2026-04-28 (feedback_non_blocking_errors_unacceptable.md), errors that do not abort are NOT acceptable; every error must log LOUD + ledger + resolve. Re-emit with explicit error-handling that surfaces and resolves."
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"trigger_id": "silent_catch_pattern",
|
|
425
|
+
"trigger": "silent or warn-and-continue catch blocks",
|
|
426
|
+
"rx": "catch\\s*\\([^)]*\\)\\s*\\{\\s*(?://[^\\n]*\\n\\s*)?(?:\\}|/\\*[^*]*\\*/|console\\.warn|return\\s+(?:null|undefined|defaultValue))",
|
|
427
|
+
"doctrine": "memory:feedback_non_blocking_errors_unacceptable.md",
|
|
428
|
+
"memory": "feedback_non_blocking_errors_unacceptable.md",
|
|
429
|
+
"severity": "warn",
|
|
430
|
+
"teaching": "Silent or warn-only catches discard error signal \u2014 they are the failure pattern this doctrine names.",
|
|
431
|
+
"counter_action": "Upgrade to console.error with structured kind+message+stack, write to discovery ledger, then either re-throw or return a typed error result.",
|
|
432
|
+
"message": "Silent or warn-only catch detected. Per feedback_non_blocking_errors_unacceptable.md every catch must LOUD-log + ledger + resolve. Replace with structured error handling."
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"trigger_id": "hook_crash_no_heartbeat",
|
|
436
|
+
"trigger": "hook scripts that lack a pre-execution heartbeat outside the crash boundary",
|
|
437
|
+
"rx": "#!/usr/bin/env\\s+node[^\\n]*\\n(?:[^\\n]*\\n){0,30}?(?:import|require)\\b",
|
|
438
|
+
"doctrine": "memory:feedback_ledger_writes_outside_crash_boundary.md",
|
|
439
|
+
"memory": "feedback_ledger_writes_outside_crash_boundary.md",
|
|
440
|
+
"severity": "warn",
|
|
441
|
+
"teaching": "A hook that crashes at import time cannot record its own death. The heartbeat must be written FIRST before any code that could throw.",
|
|
442
|
+
"counter_action": "Add an appendFileSync heartbeat at the very top of the hook (before any imports that could fail), then run imports + body.",
|
|
443
|
+
"message": "Hook script lacks pre-execution heartbeat outside crash boundary. Per feedback_ledger_writes_outside_crash_boundary.md, write a heartbeat first thing."
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"trigger_id": "packet_is_not_harness",
|
|
447
|
+
"trigger": "claiming harness state without enumerating Layer 1 / Layer 2 / Layer 3",
|
|
448
|
+
"rx": "\\b(harness[\\s_-]?bound|full[\\s_-]?harness|harness[\\s_-]?binding[\\s_-]?active|workers[\\s_-]?harnessed|harnessed\\s+with\\s+the\\s+harness|deepseek\\s+with\\s+harness)\\b",
|
|
449
|
+
"doctrine": "memory:feedback_packet_is_not_harness.md",
|
|
450
|
+
"memory": "feedback_packet_is_not_harness.md",
|
|
451
|
+
"severity": "block",
|
|
452
|
+
"teaching": "Harness has 3 layers (packet/BIND/live-gates). Claiming any consumer is harness-bound without explicitly enumerating which of the 3 layers are active for that consumer is form-only emission and the lie-by-omission Hamza caught 2026-04-28.",
|
|
453
|
+
"counter_action": "Re-emit with explicit Layer 1/2/3 enumeration: packet=yes/no, BIND=yes/no, live-gates=yes/no (and which).",
|
|
454
|
+
"message": "Harness-state claim without 3-layer enumeration. Per feedback_packet_is_not_harness.md, name explicitly which of {packet, BIND, live-gates} are active for the consumer."
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
"trigger_id": "registry_image_drift",
|
|
458
|
+
"trigger": "image.?pull|ErrImageNeverPull|ImagePullBackOff|registry gc|image.*missing|image.*not.*found",
|
|
459
|
+
"rx": "image.?pull|ErrImageNeverPull|ImagePullBackOff|registry gc|image.*missing|image.*not.*found",
|
|
460
|
+
"doctrine": "memory:feedback_registry_image_drift.md",
|
|
461
|
+
"memory": "feedback_registry_image_drift.md",
|
|
462
|
+
"severity": "warn",
|
|
463
|
+
"teaching": "Images missing from localhost:5000 is NEVER a GC problem — it's a build-gap. Every service in service-registry.json must have its image built and pushed after any registry flush, node upgrade, or cluster restart.",
|
|
464
|
+
"counter_action": "Rebuild + push the missing image via: cd apps/<service> && docker build -t localhost:5000/<image>:latest . && docker push localhost:5000/<image>:latest && kubectl rollout restart deployment/<name> -n aria. Never just delete the pod or scale-to-zero. Never blame the registry — the image was never there.",
|
|
465
|
+
"message": "Images missing from localhost:5000 — see feedback_registry_image_drift.md"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
"trigger_id": "missing_k8s_manifest",
|
|
469
|
+
"trigger": "no.*manifest|no.*deployment.*yaml|missing.*k8s|kubectl.*not.*found|deployment.*not.*exist",
|
|
470
|
+
"rx": "no.*manifest|no.*deployment.*yaml|missing.*k8s|kubectl.*not.*found|deployment.*not.*exist",
|
|
471
|
+
"doctrine": "memory:feedback_registry_image_drift.md",
|
|
472
|
+
"memory": "feedback_registry_image_drift.md",
|
|
473
|
+
"severity": "warn",
|
|
474
|
+
"teaching": "A service without a K8s manifest is not deployed — it's aspirational code. Every service in the registry must have a canonical k8s/<service>.yaml manifest. Without it, kubectl apply cannot restore the service after cluster restart.",
|
|
475
|
+
"counter_action": "Create the canonical K8s manifest (Deployment + Service + liveness probe) at k8s/<service>.yaml. Register the service in k8s/service-registry.json. Never deploy via ad-hoc kubectl run or docker run — only via a version-controlled manifest.",
|
|
476
|
+
"message": "Service lacks K8s manifest — see feedback_registry_image_drift.md"
|
|
283
477
|
}
|
|
284
478
|
]
|
|
285
479
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export const LENS_NAMES_OLDER = ['nur', 'mizan', 'hikma', 'tafakkur', 'tadabbur', 'ilham', 'wahi', 'firasah'];
|
|
2
|
+
export const LENS_NAMES_NEWER = ['zahir', 'batin', 'sabab', 'hikmah', 'aqibah', 'ilham', 'meta', 'fitrah'];
|
|
3
|
+
export const LENS_NAMES_GENERIC = ['truth', 'harm', 'trust', 'power', 'reflection', 'context', 'impact', 'beauty'];
|
|
4
|
+
|
|
5
|
+
export const PRIMARY_OWNER_LENS_NAMES = LENS_NAMES_OLDER;
|
|
6
|
+
export const PRIMARY_CLIENT_LENS_NAMES = LENS_NAMES_GENERIC;
|
|
7
|
+
|
|
8
|
+
export const ALL_LENS_NAMES = [...new Set([
|
|
9
|
+
...LENS_NAMES_OLDER,
|
|
10
|
+
...LENS_NAMES_NEWER,
|
|
11
|
+
...LENS_NAMES_GENERIC,
|
|
12
|
+
])];
|
|
13
|
+
|
|
14
|
+
export function lensNamesForTier(isOwner) {
|
|
15
|
+
return isOwner ? PRIMARY_OWNER_LENS_NAMES : PRIMARY_CLIENT_LENS_NAMES;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function canonicalLensCorrectionText() {
|
|
19
|
+
return [
|
|
20
|
+
`Owner canonical lenses: ${LENS_NAMES_OLDER.join(', ')}.`,
|
|
21
|
+
`Owner mapped counterparts that must remain represented in phase reasoning and receipts: ${LENS_NAMES_NEWER.join(', ')}.`,
|
|
22
|
+
`Readable client-safe alternatives: ${LENS_NAMES_GENERIC.join(', ')}.`,
|
|
23
|
+
].join(' ');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function extractLensTexts(cognitionInner, lensNames = ALL_LENS_NAMES) {
|
|
27
|
+
const out = {};
|
|
28
|
+
for (const lens of lensNames) {
|
|
29
|
+
const otherLensPattern = lensNames.join('|');
|
|
30
|
+
const lensRx = new RegExp(
|
|
31
|
+
`\\b${lens}\\s*:\\s*([^\\n]*(?:\\n(?!\\s*(?:${otherLensPattern})\\s*:|<\\/cognition>)[^\\n]*)*)`,
|
|
32
|
+
'i',
|
|
33
|
+
);
|
|
34
|
+
const match = cognitionInner.match(lensRx);
|
|
35
|
+
if (match) out[lens] = (match[1] || '').trim();
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function detectCognitionLenses(text, {
|
|
41
|
+
minChars = 0,
|
|
42
|
+
placeholderRx = null,
|
|
43
|
+
cognitionBlockRx = /<cognition>([\s\S]*?)<\/cognition>/i,
|
|
44
|
+
lensNames = ALL_LENS_NAMES,
|
|
45
|
+
} = {}) {
|
|
46
|
+
if (!text) return { count: 0, names: [], matchedSet: null };
|
|
47
|
+
const block = text.match(cognitionBlockRx);
|
|
48
|
+
const searchSpace = block ? block[1] : text;
|
|
49
|
+
const lensTexts = extractLensTexts(searchSpace, lensNames);
|
|
50
|
+
const names = [];
|
|
51
|
+
for (const lens of lensNames) {
|
|
52
|
+
const content = (lensTexts[lens] || '').trim();
|
|
53
|
+
if (!content) continue;
|
|
54
|
+
if (minChars > 0 && content.length < minChars) continue;
|
|
55
|
+
if (placeholderRx && placeholderRx.test(content)) continue;
|
|
56
|
+
names.push(lens);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const matchedSet =
|
|
60
|
+
[LENS_NAMES_OLDER, LENS_NAMES_NEWER, LENS_NAMES_GENERIC]
|
|
61
|
+
.find((candidateSet) => candidateSet.every((name) => names.includes(name))) || null;
|
|
62
|
+
|
|
63
|
+
return { count: names.length, names, matchedSet };
|
|
64
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { appendFileSync, existsSync, mkdirSync } from 'node:fs';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
|
|
4
|
+
export function inferDecisionFromEvent(event) {
|
|
5
|
+
if (/^block/i.test(event)) return 'block';
|
|
6
|
+
if (/^warn/i.test(event)) return 'warn';
|
|
7
|
+
return 'allow';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function appendGateAudit({
|
|
11
|
+
auditPath,
|
|
12
|
+
legacyLogPath = null,
|
|
13
|
+
gate,
|
|
14
|
+
event,
|
|
15
|
+
decision = null,
|
|
16
|
+
summary = '',
|
|
17
|
+
data = {},
|
|
18
|
+
}) {
|
|
19
|
+
const ts = new Date().toISOString();
|
|
20
|
+
const resolvedDecision = decision || inferDecisionFromEvent(event);
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
if (!existsSync(dirname(auditPath))) mkdirSync(dirname(auditPath), { recursive: true });
|
|
24
|
+
appendFileSync(
|
|
25
|
+
auditPath,
|
|
26
|
+
JSON.stringify({
|
|
27
|
+
ts,
|
|
28
|
+
gate,
|
|
29
|
+
decision: resolvedDecision,
|
|
30
|
+
event,
|
|
31
|
+
summary,
|
|
32
|
+
...data,
|
|
33
|
+
}) + '\n',
|
|
34
|
+
);
|
|
35
|
+
} catch {}
|
|
36
|
+
|
|
37
|
+
if (legacyLogPath) {
|
|
38
|
+
try {
|
|
39
|
+
if (!existsSync(dirname(legacyLogPath))) mkdirSync(dirname(legacyLogPath), { recursive: true });
|
|
40
|
+
appendFileSync(legacyLogPath, `${ts} ${event} ${summary}\n`);
|
|
41
|
+
} catch {}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -50,7 +50,7 @@ export default async function HarnessContextPlugin(ctx) {
|
|
|
50
50
|
const context = getHarnessContext();
|
|
51
51
|
if (context) {
|
|
52
52
|
try {
|
|
53
|
-
ctx.system?.prepend?.(context.slice(0,
|
|
53
|
+
ctx.system?.prepend?.(context.slice(0, 40000));
|
|
54
54
|
} catch (_) {
|
|
55
55
|
// ctx.system shape varies across OpenCode versions; if prepend isn't
|
|
56
56
|
// available we silently no-op rather than crash plugin load.
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
// - stdout: text to prepend to OpenCode's system prompt
|
|
9
9
|
// - exit 0 on success; non-zero treated as failure (plugin returns null)
|
|
10
10
|
//
|
|
11
|
-
// SDK resolution: prefers ~/.
|
|
12
|
-
// `aria connect`
|
|
13
|
-
// Cache fast-path
|
|
14
|
-
// session-start doesn't
|
|
11
|
+
// SDK resolution: prefers ~/.aria/sdk/index.js (the shared SDK installed by
|
|
12
|
+
// `aria connect`), then falls back to client-local bundles.
|
|
13
|
+
// Cache fast-path prefers ~/.aria/.aria-harness-last-packet.json so OpenCode
|
|
14
|
+
// session-start doesn't depend on Claude's local cache layout.
|
|
15
15
|
|
|
16
16
|
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
17
17
|
import { homedir } from 'node:os';
|
|
@@ -20,9 +20,18 @@ import { join } from 'node:path';
|
|
|
20
20
|
const HOME = homedir();
|
|
21
21
|
const LICENSE_PATH = join(HOME, '.aria', 'license.json');
|
|
22
22
|
const OWNER_TOKEN_PATH = join(HOME, '.aria', 'owner-token');
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const SDK_CANDIDATES = [
|
|
24
|
+
join(HOME, '.aria', 'sdk', 'index.js'),
|
|
25
|
+
join(HOME, '.codex', 'aria-sdk', 'index.js'),
|
|
26
|
+
join(HOME, '.claude', 'aria-sdk', 'index.js'),
|
|
27
|
+
];
|
|
28
|
+
const RUNTIME_URL = (process.env.ARIA_RUNTIME_URL || 'http://127.0.0.1:4319').replace(/\/+$/, '');
|
|
29
|
+
const PACKET_CACHE_PATHS = [
|
|
30
|
+
join(HOME, '.aria', '.aria-harness-last-packet.json'),
|
|
31
|
+
join(HOME, '.claude', '.aria-harness-last-packet.json'),
|
|
32
|
+
];
|
|
33
|
+
const PACKET_CACHE_TTL_SEC = Number(process.env.ARIA_HARNESS_CACHE_TTL_SEC || '300');
|
|
34
|
+
const STALE_FALLBACK_MAX_AGE_SEC = Number(process.env.ARIA_HARNESS_STALE_FALLBACK_MAX_AGE_SEC || '86400');
|
|
26
35
|
|
|
27
36
|
function fail(reason) {
|
|
28
37
|
process.stderr.write(`[inject-context] ${reason}\n`);
|
|
@@ -49,20 +58,32 @@ function resolveApiKey() {
|
|
|
49
58
|
}
|
|
50
59
|
|
|
51
60
|
function resolveBaseUrl() {
|
|
61
|
+
if (process.env.ARIA_HIVE_RUNTIME_URL) return process.env.ARIA_HIVE_RUNTIME_URL.replace(/\/+$/, '');
|
|
52
62
|
if (process.env.ARIA_HARNESS_BASE_URL) return process.env.ARIA_HARNESS_BASE_URL.replace(/\/+$/, '');
|
|
53
63
|
if (process.env.ARIA_SOUL_URL) return process.env.ARIA_SOUL_URL.replace(/\/+$/, '');
|
|
54
|
-
return '
|
|
64
|
+
return process.env.ARIA_HARNESS_URL || 'https://harness.ariasos.com';
|
|
55
65
|
}
|
|
56
66
|
|
|
57
|
-
function
|
|
67
|
+
function resolveSdkPath() {
|
|
68
|
+
return SDK_CANDIDATES.find((candidate) => existsSync(candidate)) || '';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function loadCachedPacket({ ignoreTtl = false } = {}) {
|
|
58
72
|
try {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
73
|
+
for (const cachePath of PACKET_CACHE_PATHS) {
|
|
74
|
+
if (!existsSync(cachePath)) continue;
|
|
75
|
+
const ageSec = (Date.now() - statSync(cachePath).mtimeMs) / 1000;
|
|
76
|
+
if (ignoreTtl) {
|
|
77
|
+
if (ageSec > STALE_FALLBACK_MAX_AGE_SEC) continue;
|
|
78
|
+
} else if (ageSec > PACKET_CACHE_TTL_SEC) {
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
return JSON.parse(readFileSync(cachePath, 'utf8'));
|
|
82
|
+
}
|
|
63
83
|
} catch {
|
|
64
84
|
return null;
|
|
65
85
|
}
|
|
86
|
+
return null;
|
|
66
87
|
}
|
|
67
88
|
|
|
68
89
|
function formatPacketAsContext(packet) {
|
|
@@ -78,10 +99,11 @@ function formatPacketAsContext(packet) {
|
|
|
78
99
|
}
|
|
79
100
|
|
|
80
101
|
async function fetchViaSdk(baseUrl, apiKey) {
|
|
81
|
-
|
|
82
|
-
|
|
102
|
+
const sdkPath = resolveSdkPath();
|
|
103
|
+
if (!sdkPath) {
|
|
104
|
+
fail(`SDK not found in ${SDK_CANDIDATES.join(', ')} — run \`aria connect\` to install`);
|
|
83
105
|
}
|
|
84
|
-
const mod = await import(
|
|
106
|
+
const mod = await import(sdkPath);
|
|
85
107
|
const Client = mod.HTTPHarnessClient;
|
|
86
108
|
if (!Client) fail('SDK loaded but HTTPHarnessClient not exported — bundle is broken');
|
|
87
109
|
const client = new Client({ baseUrl, apiKey, workspaceRoot: process.cwd() });
|
|
@@ -93,24 +115,61 @@ async function fetchViaSdk(baseUrl, apiKey) {
|
|
|
93
115
|
});
|
|
94
116
|
}
|
|
95
117
|
|
|
96
|
-
async function
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
118
|
+
async function fetchViaRuntime(apiKey) {
|
|
119
|
+
const response = await fetch(`${RUNTIME_URL}/packet`, {
|
|
120
|
+
method: 'POST',
|
|
121
|
+
headers: {
|
|
122
|
+
'Content-Type': 'application/json',
|
|
123
|
+
Authorization: `Bearer ${apiKey}`,
|
|
124
|
+
},
|
|
125
|
+
body: JSON.stringify({
|
|
126
|
+
packetRequest: {
|
|
127
|
+
stage: 'session-start',
|
|
128
|
+
actor: 'opencode',
|
|
129
|
+
system: 'opencode',
|
|
130
|
+
platform: 'opencode',
|
|
131
|
+
},
|
|
132
|
+
}),
|
|
133
|
+
});
|
|
134
|
+
if (!response.ok) {
|
|
135
|
+
const body = await response.text().catch(() => response.statusText);
|
|
136
|
+
throw new Error(`runtime packet fetch failed ${response.status}: ${body}`);
|
|
102
137
|
}
|
|
138
|
+
const payload = await response.json();
|
|
139
|
+
return payload.packet || payload;
|
|
140
|
+
}
|
|
103
141
|
|
|
142
|
+
async function main() {
|
|
104
143
|
const apiKey = resolveApiKey();
|
|
105
144
|
if (!apiKey) {
|
|
145
|
+
// Stale-cache fallback: if network can't fix it, serve what we have
|
|
146
|
+
const stale = loadCachedPacket({ ignoreTtl: true });
|
|
147
|
+
if (stale) {
|
|
148
|
+
process.stderr.write('[inject-context] using stale cached packet (no API key)\n');
|
|
149
|
+
process.stdout.write(formatPacketAsContext(stale));
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
106
152
|
fail('no API key — set ARIA_API_KEY or run `aria login`');
|
|
107
153
|
}
|
|
108
154
|
const baseUrl = resolveBaseUrl();
|
|
109
155
|
|
|
110
156
|
try {
|
|
111
|
-
const packet = await fetchViaSdk(baseUrl, apiKey);
|
|
157
|
+
const packet = await fetchViaRuntime(apiKey).catch(() => fetchViaSdk(baseUrl, apiKey));
|
|
112
158
|
process.stdout.write(formatPacketAsContext(packet));
|
|
159
|
+
return;
|
|
113
160
|
} catch (err) {
|
|
161
|
+
const fresh = loadCachedPacket();
|
|
162
|
+
if (fresh) {
|
|
163
|
+
process.stderr.write(`[inject-context] SDK fetch failed (${err.message}), using fresh cached packet\n`);
|
|
164
|
+
process.stdout.write(formatPacketAsContext(fresh));
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const stale = loadCachedPacket({ ignoreTtl: true });
|
|
168
|
+
if (stale) {
|
|
169
|
+
process.stderr.write(`[inject-context] network failed (${err.message}), using stale cached packet\n`);
|
|
170
|
+
process.stdout.write(formatPacketAsContext(stale));
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
114
173
|
fail(`SDK fetch failed: ${err && err.message ? err.message : String(err)}`);
|
|
115
174
|
}
|
|
116
175
|
}
|