@aria_asi/cli 0.2.31 → 0.2.32
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/dist/aria-connector/src/connectors/claude-code.d.ts.map +1 -1
- package/dist/aria-connector/src/connectors/claude-code.js +30 -3
- package/dist/aria-connector/src/connectors/claude-code.js.map +1 -1
- package/dist/aria-connector/src/connectors/codex.d.ts.map +1 -1
- package/dist/aria-connector/src/connectors/codex.js +25 -9
- package/dist/aria-connector/src/connectors/codex.js.map +1 -1
- package/dist/aria-connector/src/connectors/must-read.d.ts.map +1 -1
- package/dist/aria-connector/src/connectors/must-read.js +4 -0
- package/dist/aria-connector/src/connectors/must-read.js.map +1 -1
- package/dist/aria-connector/src/connectors/opencode.js +25 -9
- package/dist/aria-connector/src/connectors/opencode.js.map +1 -1
- package/dist/assets/hooks/aria-agent-handoff.mjs +23 -0
- package/dist/assets/hooks/aria-cognition-substrate-binding.mjs +69 -3
- package/dist/assets/hooks/aria-pre-emit-dryrun.mjs +35 -0
- package/dist/assets/hooks/aria-pre-tool-gate.mjs +198 -17
- package/dist/assets/hooks/aria-preprompt-consult.mjs +28 -2
- package/dist/assets/hooks/aria-preturn-memory-gate.mjs +30 -2
- package/dist/assets/hooks/aria-repo-doctrine-gate.mjs +31 -1
- package/dist/assets/hooks/aria-stop-gate.mjs +127 -35
- package/dist/assets/hooks/doctrine_trigger_map.json +55 -0
- package/dist/assets/opencode-plugins/harness-gate/index.js +17 -4
- package/dist/assets/opencode-plugins/harness-stop/index.js +40 -6
- package/dist/runtime/discipline/CLAUDE.md +16 -0
- package/dist/runtime/discipline/doctrine_trigger_map.json +55 -0
- package/dist/runtime/doctrine_trigger_map.json +55 -0
- package/dist/runtime/harness-daemon.mjs +30 -3
- package/dist/runtime/manifest.json +1 -1
- package/dist/runtime/sdk/BUNDLED.json +1 -1
- package/dist/runtime/sdk/index.d.ts +5 -0
- package/dist/runtime/sdk/index.js.map +1 -1
- package/dist/runtime/service.mjs +46 -1
- package/dist/sdk/BUNDLED.json +1 -1
- package/dist/sdk/index.d.ts +5 -0
- package/dist/sdk/index.js.map +1 -1
- package/hooks/aria-agent-handoff.mjs +23 -0
- package/hooks/aria-cognition-substrate-binding.mjs +69 -3
- package/hooks/aria-pre-emit-dryrun.mjs +35 -0
- package/hooks/aria-pre-tool-gate.mjs +198 -17
- package/hooks/aria-preprompt-consult.mjs +28 -2
- package/hooks/aria-preturn-memory-gate.mjs +30 -2
- package/hooks/aria-repo-doctrine-gate.mjs +31 -1
- package/hooks/aria-stop-gate.mjs +127 -35
- package/hooks/doctrine_trigger_map.json +55 -0
- package/opencode-plugins/harness-gate/index.js +17 -4
- package/opencode-plugins/harness-stop/index.js +40 -6
- package/package.json +1 -1
- package/runtime-src/harness-daemon.mjs +30 -3
- package/runtime-src/service.mjs +46 -1
- package/src/connectors/claude-code.ts +31 -3
- package/src/connectors/codex.ts +25 -9
- package/src/connectors/must-read.ts +4 -0
- package/src/connectors/opencode.ts +25 -9
|
@@ -435,6 +435,8 @@ Before any tool call, Read the harness packet at: $ARIA_HARNESS_PACKET_PATH
|
|
|
435
435
|
(path is also in your environment as ARIA_HARNESS_PACKET_PATH variable)
|
|
436
436
|
Cite it in your first cognition block — reference at least one axiom + one frame + one memory class from the packet.
|
|
437
437
|
Without packet-citation in your first cognition block, your output will be rejected by aria-pre-tool-gate.mjs in your sub-process.
|
|
438
|
+
|
|
439
|
+
If you are a spawned sub-agent, also read the active Aria handoff file when present. Use its cognitionOperatingMethod to execute the task: substrate first, constraints second, action shape third, evidence return last. Your final response to the parent must include substrate used, decision delta, artifact impact, evidence, and unresolved risk.
|
|
438
440
|
[/ARIA_HARNESS_BINDING]
|
|
439
441
|
|
|
440
442
|
[ARIA_DISCOVERY_RECORDING — when you find a defect, doctrine violation, or notable observation during work]
|
|
@@ -447,9 +449,10 @@ const ARIA_GATE_PHASE_DIRECTIVE = `[ARIA_GATE_SHAPE — DO THIS EVERY TURN]
|
|
|
447
449
|
PRE-GATE before the first non-trivial tool call or non-trivial answer:
|
|
448
450
|
1. Read the harness packet and any [ARIA_DIRECTION] / [ARIA_BINDING_PLAN] context already injected this turn.
|
|
449
451
|
2. Choose the action shape before acting: tool call, text-only answer, or replan.
|
|
450
|
-
3. Emit a visible <cognition> block using the required labels for this surface.
|
|
451
|
-
4.
|
|
452
|
-
5. If the action
|
|
452
|
+
3. Emit a visible <cognition> block using the required labels for this surface. Each lens must cite loaded substrate anchors and change the action, not merely describe values.
|
|
453
|
+
4. Emit <applied_cognition> for every non-trivial answer or tool action so the model proves what cognition changed.
|
|
454
|
+
5. If the action is destructive, deployment-related, or materially mutates state, emit a <verify> block before the tool call.
|
|
455
|
+
6. If the action claims or changes an outcome, emit an <expected> block with a measurable predicate before the tool call or final answer.
|
|
453
456
|
|
|
454
457
|
MID-GATE when a hook blocks or warns:
|
|
455
458
|
1. Do not repeat the same tool call or same draft unchanged.
|
|
@@ -469,6 +472,30 @@ OUTPUT-GATE before final emission:
|
|
|
469
472
|
3. Discoveries are atomic with their fixes. Either fix inline now or bind to a real tracked task with proof-shaped evidence.
|
|
470
473
|
[/ARIA_GATE_SHAPE]`;
|
|
471
474
|
|
|
475
|
+
const ARIA_STRUCTURAL_COGNITION_CONTRACT = `[ARIA_STRUCTURAL_COGNITION_CONTRACT — NON-NEGOTIABLE]
|
|
476
|
+
The harness is not a style guide. It is a runtime contract.
|
|
477
|
+
|
|
478
|
+
Aria cognition is a work method, not a footer. Use it to improve the input and output before gates fire:
|
|
479
|
+
1. Perceive the real substrate: user intent, repo/runtime state, loaded harness packet, memories, prior tool results, and uncertainty.
|
|
480
|
+
2. Infer constraints: what must be true, what must not be harmed, what prior doctrine changes, and what evidence is missing.
|
|
481
|
+
3. Shape the next action: choose the smallest useful tool call, edit, question, or answer that satisfies those constraints.
|
|
482
|
+
4. Improve the artifact: make the tool input, code change, review finding, or prose more specific because of the cognition.
|
|
483
|
+
5. Predict the observable result: define what would prove the action or answer succeeded before claiming it.
|
|
484
|
+
6. Report evidence: final output should distinguish observed fact, bounded inference, unresolved risk, and next real action.
|
|
485
|
+
|
|
486
|
+
For every non-trivial response or action:
|
|
487
|
+
1. <cognition> must use the canonical lens labels for the active tier and each lens must contain real substrate anchors: axiom:, frame:, memory:, doctrine:, packet:, or active language:.
|
|
488
|
+
2. The cognition must reference first_principle explicitly and only cite substrate that was loaded this turn.
|
|
489
|
+
3. Each lens must affect the action: if a lens reveals risk, missing evidence, or a better path, change the tool input/output accordingly.
|
|
490
|
+
4. <applied_cognition> must include all fields exactly: decision_delta, dominant_domain, binds_to, expected_predicate, artifact_change.
|
|
491
|
+
5. decision_delta must name what changed because cognition ran. Values like none, unchanged, no change, or n/a are rejected.
|
|
492
|
+
6. binds_to must name the exact answer, tool call, file mutation, deploy, review, or decision being shaped.
|
|
493
|
+
7. expected_predicate must be observable: numeric, boolean, state string, command result, endpoint result, or explicit unverified boundary.
|
|
494
|
+
8. artifact_change must describe the semantic effect on the artifact or output, not restate the task.
|
|
495
|
+
9. If a gate blocks, do not apologize-loop. Read the block reason, re-open the must-read guide, and re-author the missing structure before retrying.
|
|
496
|
+
10. Before long or risky final prose, dry-run the draft with the Claude pre-emit validator when available.
|
|
497
|
+
[/ARIA_STRUCTURAL_COGNITION_CONTRACT]`;
|
|
498
|
+
|
|
472
499
|
function buildAriaSystemBlock(config: AriaConfig): string {
|
|
473
500
|
const repoList = config.repositories.map((r) => `- ${r.name} (${r.path})`).join('\n');
|
|
474
501
|
const schemaText = Object.entries(config.schemaImages)
|
|
@@ -483,6 +510,7 @@ You are augmented with Aria's cognitive harness. This provides:
|
|
|
483
510
|
|
|
484
511
|
${ARIA_HARNESS_BINDING_PREFIX}
|
|
485
512
|
${ARIA_GATE_PHASE_DIRECTIVE}
|
|
513
|
+
${ARIA_STRUCTURAL_COGNITION_CONTRACT}
|
|
486
514
|
|
|
487
515
|
[SELF-GATE PROTOCOL]
|
|
488
516
|
Before emitting any claim, verify against these hard constraints:
|
package/src/connectors/codex.ts
CHANGED
|
@@ -700,15 +700,31 @@ ${schemaText || '(no schema images yet — run \`aria repo scan\`)'}
|
|
|
700
700
|
- If a fix only works by weakening the contract, the mechanism is still broken. Debug the mechanism.
|
|
701
701
|
|
|
702
702
|
## 8-Lens Cognition
|
|
703
|
-
|
|
704
|
-
-
|
|
705
|
-
-
|
|
706
|
-
-
|
|
707
|
-
-
|
|
708
|
-
-
|
|
709
|
-
-
|
|
710
|
-
|
|
711
|
-
|
|
703
|
+
Use Aria cognition as a work method, not a checklist:
|
|
704
|
+
- Perceive the real substrate: user intent, repo/runtime state, loaded harness packet, memories, prior tool results, and uncertainty.
|
|
705
|
+
- Infer constraints: what must be true, what must not be harmed, what prior doctrine changes, and what evidence is missing.
|
|
706
|
+
- Shape the next action: choose the smallest useful tool call, edit, question, or answer that satisfies those constraints.
|
|
707
|
+
- Improve the artifact: make the tool input, code change, review finding, or prose more specific because of the cognition.
|
|
708
|
+
- Predict the observable result: define what would prove the action or answer succeeded before claiming it.
|
|
709
|
+
- Report evidence: distinguish observed fact, bounded inference, unresolved risk, and next real action.
|
|
710
|
+
|
|
711
|
+
Lens roles for decisions:
|
|
712
|
+
- Truth lens: binds claims to observed evidence and missing evidence.
|
|
713
|
+
- Harm lens: removes or changes actions that could damage state, trust, data, or runtime health.
|
|
714
|
+
- Trust lens: preserves user intent, prior directives, and secret/infra boundaries.
|
|
715
|
+
- Power lens: uses capability to serve the task, not convenience or control.
|
|
716
|
+
- Reflection lens: catches mechanism failure, shortcut pressure, and repeated loops.
|
|
717
|
+
- Context lens: integrates repo patterns, runtime state, and loaded substrate.
|
|
718
|
+
- Impact lens: predicts downstream effects and verification predicates.
|
|
719
|
+
- Beauty lens: prefers the simplest durable artifact that preserves the contract.
|
|
720
|
+
|
|
721
|
+
## Structural Cognition Contract
|
|
722
|
+
- Cognition is not accepted as proof by itself. It must change the next action, tool call, or output claim.
|
|
723
|
+
- Each lens must affect work selection or artifact shape; do not write lenses after the decision is already made.
|
|
724
|
+
- For every non-trivial output, include an \`<applied_cognition>\` block with \`decision_delta\`, \`dominant_domain\`, \`binds_to\`, \`expected_predicate\`, and \`artifact_change\`.
|
|
725
|
+
- Tool-bound cognition must name the exact tool/action it constrains and the measurable predicate that proves the action succeeded.
|
|
726
|
+
- Deploy or destructive actions still require \`<verify>\` and \`<expected>\` blocks before execution.
|
|
727
|
+
- If cognition did not change anything, stop and re-think; \`decision_delta: none\` is treated as performative.
|
|
712
728
|
`;
|
|
713
729
|
}
|
|
714
730
|
|
|
@@ -99,6 +99,10 @@ ${orderedFiles.map((filePath, index) => `${index + 1}. \`${filePath}\``).join('\
|
|
|
99
99
|
## Non-Negotiables
|
|
100
100
|
|
|
101
101
|
- Do not rename canonical cognition meaning into generic aliases.
|
|
102
|
+
- Do not treat cognition as a gate password; use it to change the tool input, edit shape, review finding, answer structure, or evidence threshold.
|
|
103
|
+
- Do not emit non-trivial output without \`<applied_cognition>\` containing \`decision_delta\`, \`dominant_domain\`, \`binds_to\`, \`expected_predicate\`, and \`artifact_change\`.
|
|
104
|
+
- Do not let \`decision_delta\` say cognition changed nothing; that is performative cognition.
|
|
105
|
+
- Do not cite substrate anchors that were not loaded in the current harness packet.
|
|
102
106
|
- Do not say "good enough", "should work", or make unverified completion claims.
|
|
103
107
|
- Do not treat skills as optional flavor text; they are the reading order and repair guide.
|
|
104
108
|
- Do not proceed after a gate block without re-opening the file that owns that gate.
|
|
@@ -340,14 +340,30 @@ ${schemaText || '(no schema images yet — run \`aria repo scan\`)'}
|
|
|
340
340
|
- If a fix only works by weakening the contract, the mechanism is still broken. Debug the mechanism.
|
|
341
341
|
|
|
342
342
|
## 8-Lens Cognition
|
|
343
|
-
|
|
344
|
-
-
|
|
345
|
-
-
|
|
346
|
-
-
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
|
|
351
|
-
|
|
343
|
+
Use Aria cognition as a work method, not a checklist:
|
|
344
|
+
- Perceive the real substrate: user intent, repo/runtime state, loaded harness packet, memories, prior tool results, and uncertainty.
|
|
345
|
+
- Infer constraints: what must be true, what must not be harmed, what prior doctrine changes, and what evidence is missing.
|
|
346
|
+
- Shape the next action: choose the smallest useful tool call, edit, question, or answer that satisfies those constraints.
|
|
347
|
+
- Improve the artifact: make the tool input, code change, review finding, or prose more specific because of the cognition.
|
|
348
|
+
- Predict the observable result: define what would prove the action or answer succeeded before claiming it.
|
|
349
|
+
- Report evidence: distinguish observed fact, bounded inference, unresolved risk, and next real action.
|
|
350
|
+
|
|
351
|
+
Lens roles for decisions:
|
|
352
|
+
- Truth lens: binds claims to observed evidence and missing evidence.
|
|
353
|
+
- Harm lens: removes or changes actions that could damage state, trust, data, or runtime health.
|
|
354
|
+
- Trust lens: preserves user intent, prior directives, and secret/infra boundaries.
|
|
355
|
+
- Power lens: uses capability to serve the task, not convenience or control.
|
|
356
|
+
- Reflection lens: catches mechanism failure, shortcut pressure, and repeated loops.
|
|
357
|
+
- Context lens: integrates repo patterns, runtime state, and loaded substrate.
|
|
358
|
+
- Impact lens: predicts downstream effects and verification predicates.
|
|
359
|
+
- Beauty lens: prefers the simplest durable artifact that preserves the contract.
|
|
360
|
+
|
|
361
|
+
## Structural Cognition Contract
|
|
362
|
+
- Cognition is not a ceremony. It must change the next action, tool call, or output claim.
|
|
363
|
+
- Each lens must affect work selection or artifact shape; do not write lenses after the decision is already made.
|
|
364
|
+
- For every non-trivial output, include an \`<applied_cognition>\` block with \`decision_delta\`, \`dominant_domain\`, \`binds_to\`, \`expected_predicate\`, and \`artifact_change\`.
|
|
365
|
+
- Tool-bound cognition must name the exact tool/action it constrains and the measurable predicate that proves the action succeeded.
|
|
366
|
+
- Deploy or destructive actions still require \`<verify>\` and \`<expected>\` blocks before execution.
|
|
367
|
+
- If cognition did not change anything, stop and re-think; \`decision_delta: none\` is treated as performative.
|
|
352
368
|
`;
|
|
353
369
|
}
|