orkeon-code 1.0.0-rc.1 → 1.0.0-rc.3
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/.orkeon-runtime +11 -0
- package/.orkeon-version +1 -1
- package/NOTICE.md +1 -1
- package/README.fr.md +16 -22
- package/README.md +16 -22
- package/config/appsettings.jev.example.json +4 -1
- package/config/appsettings.kev.example.json +4 -1
- package/config/appsettings.liquid.example.json +4 -1
- package/config/appsettings.ollama-whisper.example.json +1 -0
- package/config/appsettings.whisper.example.json +1 -0
- package/mcp/whisper/README.md +2 -1
- package/orkeon-code +508 -80
- package/orkeon-code.ps1 +129 -11
- package/package.json +3 -1
- package/scripts/dev-run.sh +139 -0
- package/src/commands/.orkeon/orkeon-cli.d.ts +1 -4
- package/src/commands/_lib/args.ts +5 -4
- package/src/commands/_lib/dev/dev-batches.ts +34 -36
- package/src/commands/_lib/dev/dev-implement.ts +11 -14
- package/src/commands/_lib/dev/dev-source.ts +7 -11
- package/src/commands/_lib/dev/dev.ts +34 -37
- package/src/commands/_lib/dev/markers.ts +7 -0
- package/src/commands/_lib/dev/messages.ts +112 -0
- package/src/commands/_lib/dev-step.ts +16 -13
- package/src/commands/_lib/dispatch.ts +62 -39
- package/src/commands/_lib/git/branch.ts +9 -10
- package/src/commands/_lib/git/commit.ts +9 -13
- package/src/commands/_lib/git/diff.ts +22 -12
- package/src/commands/_lib/git/messages.ts +54 -0
- package/src/commands/_lib/git/review.ts +9 -10
- package/src/commands/_lib/memory/memory-admit.ts +19 -21
- package/src/commands/_lib/memory/memory.ts +3 -2
- package/src/commands/_lib/memory/messages.ts +32 -0
- package/src/commands/_lib/messages.ts +48 -0
- package/src/commands/_lib/project/messages.ts +8 -0
- package/src/commands/_lib/session/export.ts +3 -2
- package/src/commands/_lib/session/messages.ts +87 -0
- package/src/commands/_lib/session/prompts.ts +4 -0
- package/src/commands/_lib/session/resume.ts +15 -24
- package/src/commands/_lib/session/tasks.ts +20 -23
- package/src/commands/_lib/settings/advisor.ts +11 -16
- package/src/commands/_lib/settings/agents.ts +18 -28
- package/src/commands/_lib/settings/choices.ts +8 -0
- package/src/commands/_lib/settings/config.ts +43 -43
- package/src/commands/_lib/settings/effort.ts +147 -0
- package/src/commands/_lib/settings/hooks.ts +12 -20
- package/src/commands/_lib/settings/messages.ts +408 -0
- package/src/commands/_lib/settings/mode.ts +33 -24
- package/src/commands/_lib/settings/model.ts +71 -36
- package/src/commands/_lib/settings/output-style.ts +39 -0
- package/src/commands/_lib/settings/permissions.ts +71 -93
- package/src/commands/_lib/settings/route.ts +63 -0
- package/src/commands/_lib/settings/skills.ts +53 -11
- package/src/commands/_lib/settings/theme.ts +42 -0
- package/src/commands/_lib/speech/messages.ts +58 -0
- package/src/commands/_lib/speech/prompts.ts +4 -0
- package/src/commands/_lib/speech/say.ts +9 -10
- package/src/commands/_lib/speech/transcribe.ts +14 -23
- package/src/commands/_lib/speech/voice.ts +14 -18
- package/src/commands/_lib/status/doctor.ts +47 -28
- package/src/commands/_lib/status/messages.ts +101 -0
- package/src/commands/_lib/status/meta.ts +5 -25
- package/src/commands/_lib/status/status.ts +10 -11
- package/src/commands/_lib/status/usage-tools.ts +2 -3
- package/src/commands/_lib/status/usage.ts +7 -18
- package/src/commands/_lib/view.ts +6 -1
- package/src/commands/dev/dev-batches.cmd.ts +4 -3
- package/src/commands/dev/dev-learn.cmd.ts +3 -3
- package/src/commands/dev/dev-plan.cmd.ts +6 -7
- package/src/commands/dev/dev-spec.cmd.ts +6 -7
- package/src/commands/git/commit.cmd.ts +3 -3
- package/src/commands/git/review.cmd.ts +3 -3
- package/src/commands/memory/memory.cmd.ts +2 -2
- package/src/commands/project/analyze.cmd.ts +3 -3
- package/src/commands/project/debug-tool-call.cmd.ts +4 -9
- package/src/commands/project/init-verifiers.cmd.ts +3 -3
- package/src/commands/project/init.cmd.ts +3 -3
- package/src/commands/project/verify.cmd.ts +2 -2
- package/src/commands/session/assistant.cmd.ts +2 -2
- package/src/commands/session/compact.cmd.ts +1 -1
- package/src/commands/session/copy.cmd.ts +8 -7
- package/src/commands/session/rename.cmd.ts +3 -2
- package/src/commands/session/rewind.cmd.ts +3 -4
- package/src/commands/session/summary.cmd.ts +3 -3
- package/src/commands/session/tasks.cmd.ts +4 -2
- package/src/commands/settings/config.cmd.ts +4 -2
- package/src/commands/settings/effort.cmd.ts +10 -31
- package/src/commands/settings/fast.cmd.ts +2 -1
- package/src/commands/settings/mode.cmd.ts +3 -3
- package/src/commands/settings/model.cmd.ts +3 -2
- package/src/commands/settings/output-style.cmd.ts +9 -38
- package/src/commands/settings/permissions.cmd.ts +2 -2
- package/src/commands/settings/proactive.cmd.ts +2 -1
- package/src/commands/settings/route.cmd.ts +16 -0
- package/src/commands/settings/skills.cmd.ts +3 -3
- package/src/commands/settings/theme.cmd.ts +14 -0
- package/src/commands/speech/say.cmd.ts +2 -2
- package/src/commands/speech/transcribe.cmd.ts +2 -2
- package/src/commands/status/release-notes.cmd.ts +1 -1
- package/src/crews/.orkeon/orkeon.d.ts +539 -94
- package/src/crews/_probe-shared-memory/domain/messages.ts +54 -0
- package/src/crews/_probe-shared-memory/domain/probe-verdict.ts +17 -12
- package/src/crews/_probe-shared-memory/domain/prompts.ts +5 -0
- package/src/crews/_probe-shared-memory/probe.ork.ts +8 -6
- package/src/crews/advisor/application/messages.ts +4 -0
- package/src/crews/advisor/application/prompts.ts +4 -0
- package/src/crews/advisor/application/run-advisor.ts +2 -1
- package/src/crews/advisor/crew.ork.ts +6 -5
- package/src/crews/advisor/domain/advice.ts +7 -23
- package/src/crews/advisor/domain/messages.ts +8 -0
- package/src/crews/advisor/domain/prompts.ts +26 -0
- package/src/crews/agent-run/application/messages.ts +18 -0
- package/src/crews/agent-run/application/run-agent-run.ts +5 -4
- package/src/crews/agent-run/crew.ork.ts +4 -4
- package/src/crews/analyze/application/messages.ts +27 -0
- package/src/crews/analyze/application/prompts.ts +4 -0
- package/src/crews/analyze/application/run-analyze.ts +16 -14
- package/src/crews/analyze/crew.ork.ts +5 -4
- package/src/crews/analyze/domain/harvest.ts +33 -65
- package/src/crews/analyze/domain/prompts.ts +86 -0
- package/src/crews/code-review/application/lens-material.ts +24 -0
- package/src/crews/code-review/application/messages.ts +17 -0
- package/src/crews/code-review/application/prompts.ts +10 -17
- package/src/crews/code-review/application/review.ts +4 -1
- package/src/crews/code-review/application/run-code-review.ts +13 -15
- package/src/crews/code-review/crew.ork.ts +6 -5
- package/src/crews/code-review/domain/lenses.ts +6 -45
- package/src/crews/code-review/domain/messages.ts +25 -0
- package/src/crews/code-review/domain/prompts.ts +58 -0
- package/src/crews/code-review/domain/report.ts +5 -6
- package/src/crews/code-review/domain/scope.ts +6 -12
- package/src/crews/dev-batches/application/messages.ts +127 -0
- package/src/crews/dev-batches/application/plan-close.ts +12 -12
- package/src/crews/dev-batches/application/prompts.ts +10 -0
- package/src/crews/dev-batches/application/run-dev-batches.ts +57 -50
- package/src/crews/dev-batches/application/run-wave.ts +24 -22
- package/src/crews/dev-batches/application/seed-harvest.ts +8 -7
- package/src/crews/dev-batches/crew.ork.ts +13 -10
- package/src/crews/dev-batches/domain/batches-log.ts +1 -3
- package/src/crews/dev-batches/domain/markers.ts +5 -0
- package/src/crews/dev-batches/domain/messages.ts +6 -0
- package/src/crews/dev-batches/domain/wave-order.ts +3 -2
- package/src/crews/dev-change/application/change-material.ts +44 -0
- package/src/crews/dev-change/application/evidence.ts +25 -22
- package/src/crews/dev-change/application/messages.ts +81 -0
- package/src/crews/dev-change/application/{change-prompt.ts → prompts.ts} +40 -43
- package/src/crews/dev-change/application/run-dev-change.ts +43 -34
- package/src/crews/dev-change/crew.ork.ts +11 -9
- package/src/crews/dev-change/domain/change-answer.ts +24 -20
- package/src/crews/dev-change/domain/change-render.ts +14 -16
- package/src/crews/dev-change/domain/markers.ts +28 -0
- package/src/crews/dev-change/domain/messages.ts +16 -0
- package/src/crews/dev-implement/application/close.ts +21 -18
- package/src/crews/dev-implement/application/locate-sheet.ts +7 -5
- package/src/crews/dev-implement/application/messages.ts +161 -0
- package/src/crews/dev-implement/application/observe.ts +4 -2
- package/src/crews/dev-implement/application/prompts.ts +9 -0
- package/src/crews/dev-implement/application/report-writes.ts +14 -9
- package/src/crews/dev-implement/application/run-dev-implement.ts +84 -73
- package/src/crews/dev-implement/application/suite-job.ts +15 -11
- package/src/crews/dev-implement/crew.ork.ts +2 -1
- package/src/crews/dev-implement/domain/contracts.ts +59 -60
- package/src/crews/dev-implement/domain/correction.ts +16 -15
- package/src/crews/dev-implement/domain/cycles.ts +2 -1
- package/src/crews/dev-implement/domain/markers.ts +23 -0
- package/src/crews/dev-implement/domain/messages.ts +58 -0
- package/src/crews/dev-implement/domain/prompts.ts +93 -0
- package/src/crews/dev-implement/domain/roles.ts +3 -7
- package/src/crews/dev-implement/domain/sheet-edits.ts +6 -5
- package/src/crews/dev-implement/domain/sheet-ticks.ts +5 -4
- package/src/crews/dev-implement/domain/step-checks.ts +17 -16
- package/src/crews/dev-implement/domain/step-section.ts +6 -4
- package/src/crews/dev-learn/application/learn-prompt-fit.ts +63 -0
- package/src/crews/dev-learn/application/messages.ts +56 -0
- package/src/crews/dev-learn/application/prompts.ts +96 -0
- package/src/crews/dev-learn/application/run-dev-learn.ts +51 -43
- package/src/crews/dev-learn/crew.ork.ts +5 -4
- package/src/crews/dev-learn/domain/learn-answer.ts +60 -37
- package/src/crews/dev-learn/domain/markers.ts +10 -0
- package/src/crews/dev-learn/domain/messages.ts +74 -0
- package/src/crews/dev-learn/domain/owner-lines.ts +12 -9
- package/src/crews/dev-learn/domain/proposals-render.ts +8 -9
- package/src/crews/dev-plan/application/anchor-paths.ts +57 -20
- package/src/crews/dev-plan/application/inventory.ts +17 -13
- package/src/crews/dev-plan/application/messages.ts +88 -0
- package/src/crews/dev-plan/application/plan-prompt-fit.ts +44 -0
- package/src/crews/dev-plan/application/{plan-prompt.ts → prompts.ts} +37 -55
- package/src/crews/dev-plan/application/run-dev-plan.ts +103 -75
- package/src/crews/dev-plan/crew.ork.ts +12 -9
- package/src/crews/dev-plan/domain/inventory-model.ts +3 -3
- package/src/crews/dev-plan/domain/markers.ts +18 -0
- package/src/crews/dev-plan/domain/messages.ts +118 -0
- package/src/crews/dev-plan/domain/plan-answer.ts +118 -103
- package/src/crews/dev-plan/domain/plan-render.ts +33 -34
- package/src/crews/dev-plan/domain/prompts.ts +44 -0
- package/src/crews/dev-spec/application/messages.ts +30 -0
- package/src/crews/dev-spec/application/{spec-prompt.ts → prompts.ts} +42 -47
- package/src/crews/dev-spec/application/run-dev-spec.ts +67 -36
- package/src/crews/dev-spec/application/spec-material.ts +42 -0
- package/src/crews/dev-spec/crew.ork.ts +11 -9
- package/src/crews/dev-spec/domain/markers.ts +30 -0
- package/src/crews/dev-spec/domain/messages.ts +39 -0
- package/src/crews/dev-spec/domain/spec-answer.ts +46 -47
- package/src/crews/dev-spec/domain/spec-render.ts +21 -21
- package/src/crews/dev-verify/application/audit-brief.ts +187 -0
- package/src/crews/dev-verify/application/audit.ts +38 -30
- package/src/crews/dev-verify/application/capture.ts +34 -26
- package/src/crews/dev-verify/application/messages.ts +119 -0
- package/src/crews/dev-verify/application/prompts.ts +209 -0
- package/src/crews/dev-verify/application/run-dev-verify.ts +60 -46
- package/src/crews/dev-verify/application/run-gate.ts +11 -9
- package/src/crews/dev-verify/crew.ork.ts +7 -7
- package/src/crews/dev-verify/domain/audit-answer.ts +16 -12
- package/src/crews/dev-verify/domain/capture-sections.ts +5 -4
- package/src/crews/dev-verify/domain/commands.ts +3 -3
- package/src/crews/dev-verify/domain/gate.ts +21 -16
- package/src/crews/dev-verify/domain/markers.ts +16 -0
- package/src/crews/dev-verify/domain/mechanical-table.ts +37 -44
- package/src/crews/dev-verify/domain/messages.ts +92 -0
- package/src/crews/dev-verify/domain/verdict.ts +4 -4
- package/src/crews/git-commit/application/draft.ts +38 -55
- package/src/crews/git-commit/application/messages.ts +17 -0
- package/src/crews/git-commit/application/prompts.ts +47 -0
- package/src/crews/git-commit/application/run-git-commit.ts +16 -13
- package/src/crews/git-commit/crew.ork.ts +6 -5
- package/src/crews/git-commit/domain/commit.ts +15 -35
- package/src/crews/git-commit/domain/markers.ts +4 -0
- package/src/crews/git-commit/domain/messages.ts +48 -0
- package/src/crews/init-verifiers/application/authoring.ts +2 -1
- package/src/crews/init-verifiers/application/messages.ts +13 -0
- package/src/crews/init-verifiers/application/prompts.ts +5 -1
- package/src/crews/init-verifiers/application/run-init-verifiers.ts +3 -2
- package/src/crews/init-verifiers/crew.ork.ts +6 -5
- package/src/crews/main-loop/application/auto-compact.ts +2 -1
- package/src/crews/main-loop/application/messages.ts +81 -0
- package/src/crews/main-loop/application/prompts.ts +12 -0
- package/src/crews/main-loop/application/run-main-loop.ts +64 -31
- package/src/crews/main-loop/application/{turn-prompt.ts → turn-context.ts} +7 -8
- package/src/crews/main-loop/crew.ork.ts +12 -7
- package/src/crews/main-loop/domain/prompt-assembly.ts +45 -228
- package/src/crews/main-loop/domain/prompts.ts +336 -0
- package/src/crews/main-loop/domain/turn-chains.ts +10 -9
- package/src/crews/project-init/application/detect.ts +5 -4
- package/src/crews/project-init/application/messages.ts +15 -0
- package/src/crews/project-init/application/prompts.ts +11 -7
- package/src/crews/project-init/crew.ork.ts +6 -5
- package/src/crews/project-init/domain/existing-files.ts +6 -4
- package/src/crews/project-init/domain/messages.ts +13 -0
- package/src/crews/project-init/domain/package-map.ts +3 -3
- package/src/crews/project-init/domain/prompts.ts +10 -0
- package/src/crews/session-compact/application/prompts.ts +5 -0
- package/src/crews/session-compact/crew.ork.ts +6 -5
- package/src/crews/shared-memory-admit/application/prompts.ts +5 -0
- package/src/crews/shared-memory-admit/crew.ork.ts +4 -3
- package/src/crews/speech/application/messages.ts +3 -0
- package/src/crews/speech/application/prompts.ts +3 -0
- package/src/crews/speech/application/run-speech.ts +2 -1
- package/src/crews/speech/crew.ork.ts +2 -1
- package/src/shared/application/agents/child-agent.ts +11 -7
- package/src/shared/application/agents/messages.ts +35 -0
- package/src/shared/application/agents/route-agent.ts +115 -0
- package/src/shared/application/agents/run-sub-agent.ts +31 -8
- package/src/shared/application/compaction/compact-session.ts +19 -14
- package/src/shared/application/compaction/messages.ts +20 -0
- package/src/shared/application/compaction/prune-context.ts +94 -0
- package/src/shared/application/compaction/pruned-llm.ts +35 -0
- package/src/shared/application/dev/brief-inventory.ts +6 -4
- package/src/shared/application/dev/close-batch.ts +9 -7
- package/src/shared/application/dev/find-repo-pack.ts +4 -3
- package/src/shared/application/dev/learn-decision.ts +20 -18
- package/src/shared/application/dev/load-dev-context.ts +7 -8
- package/src/shared/application/dev/measure-access-cost.ts +5 -4
- package/src/shared/application/dev/messages.ts +135 -0
- package/src/shared/application/dev/phase-timer.ts +54 -0
- package/src/shared/application/dev/plan-source.ts +12 -8
- package/src/shared/application/dev/preflight.ts +16 -11
- package/src/shared/application/dev/prompts.ts +34 -0
- package/src/shared/application/dev/question-round.ts +25 -17
- package/src/shared/application/dev/resolve-work-folder.ts +4 -3
- package/src/shared/application/dev/settle-questions.ts +4 -2
- package/src/shared/application/dev/source-review.ts +12 -8
- package/src/shared/application/dev/source-step.ts +12 -10
- package/src/shared/application/dev/spend.ts +17 -4
- package/src/shared/application/dev/step-precedents.ts +2 -1
- package/src/shared/application/dev/tool-call-policy.ts +9 -11
- package/src/shared/application/dev/tool-callbacks.ts +52 -5
- package/src/shared/application/dev/tool-trace-recorder.ts +2 -1
- package/src/shared/application/dev/verdict-sources.ts +5 -3
- package/src/shared/application/dev/wrapped-tools.ts +4 -2
- package/src/shared/application/extra-tools.ts +2 -1
- package/src/shared/application/git/batch-worktree.ts +22 -17
- package/src/shared/application/git/commit-files.ts +24 -19
- package/src/shared/application/git/merge-batch.ts +11 -7
- package/src/shared/application/git/messages.ts +75 -0
- package/src/shared/application/git/open-pull-request.ts +4 -3
- package/src/shared/application/host-context.ts +59 -0
- package/src/shared/application/host-layout-store.ts +45 -0
- package/src/shared/application/llm-profile.ts +4 -3
- package/src/shared/application/messages.ts +14 -0
- package/src/shared/application/permission-rules.ts +10 -0
- package/src/shared/application/ports/decision.ts +14 -0
- package/src/shared/application/ports/human.ts +25 -0
- package/src/shared/application/ports/llm.ts +32 -3
- package/src/shared/application/ports/memory.ts +1 -1
- package/src/shared/application/ports/theme.ts +11 -0
- package/src/shared/application/ports.ts +4 -2
- package/src/shared/application/session-io.ts +2 -1
- package/src/shared/application/shared-memory/admit-entries.ts +16 -14
- package/src/shared/application/shared-memory/harvest-after-gaps.ts +5 -8
- package/src/shared/application/shared-memory/harvest-mistakes.ts +3 -2
- package/src/shared/application/shared-memory/import-agent-memory.ts +9 -7
- package/src/shared/application/shared-memory/memory-files.ts +2 -1
- package/src/shared/application/shared-memory/memory-settings.ts +2 -1
- package/src/shared/application/shared-memory/messages.ts +63 -0
- package/src/shared/application/shared-memory/push-candidate.ts +14 -11
- package/src/shared/application/shared-memory/recall-precedents.ts +2 -1
- package/src/shared/application/skills/messages.ts +4 -0
- package/src/shared/application/skills/suggest-skills.ts +102 -0
- package/src/shared/application/workflow/messages.ts +8 -0
- package/src/shared/application/workflow/workflow-state.ts +7 -6
- package/src/shared/domain/agent-policy/behavior-flags.ts +4 -10
- package/src/shared/domain/agent-policy/extra-tools.ts +2 -4
- package/src/shared/domain/agent-policy/messages.ts +66 -0
- package/src/shared/domain/agent-policy/path-rules.ts +299 -0
- package/src/shared/domain/agent-policy/permission.ts +20 -18
- package/src/shared/domain/agent-policy/prompts.ts +17 -0
- package/src/shared/domain/agent-policy/reasoning.ts +59 -0
- package/src/shared/domain/agent-policy/rule-sets.ts +18 -14
- package/src/shared/domain/agent-policy/tool-access.ts +17 -3
- package/src/shared/domain/agent-registry.ts +6 -5
- package/src/shared/domain/agents/chain.ts +2 -2
- package/src/shared/domain/agents/charter.ts +8 -5
- package/src/shared/domain/agents/exclusive.ts +2 -1
- package/src/shared/domain/agents/instances.ts +18 -15
- package/src/shared/domain/agents/messages.ts +39 -0
- package/src/shared/domain/agents/model-route.ts +199 -0
- package/src/shared/domain/agents/prompts.ts +20 -0
- package/src/shared/domain/code-intel-contract.ts +5 -4
- package/src/shared/domain/code-intel-routing.ts +8 -61
- package/src/shared/domain/compact-outcome.ts +5 -3
- package/src/shared/domain/compaction-thresholds.ts +2 -1
- package/src/shared/domain/compaction.ts +22 -113
- package/src/shared/domain/config-schema.ts +94 -81
- package/src/shared/domain/context-prune.ts +176 -0
- package/src/shared/domain/decision/questions.ts +102 -0
- package/src/shared/domain/dev/access-cost.ts +19 -15
- package/src/shared/domain/dev/batches-concurrency.ts +5 -6
- package/src/shared/domain/dev/build-commands.ts +5 -4
- package/src/shared/domain/dev/call-guard.ts +29 -28
- package/src/shared/domain/dev/carried-text.ts +3 -5
- package/src/shared/domain/dev/learn-proposals.ts +51 -12
- package/src/shared/domain/dev/learn-state.ts +3 -2
- package/src/shared/domain/dev/markers.ts +127 -0
- package/src/shared/domain/dev/messages.ts +271 -0
- package/src/shared/domain/dev/phase-timing.ts +50 -0
- package/src/shared/domain/dev/plan-checks.ts +24 -23
- package/src/shared/domain/dev/plan-format.ts +15 -25
- package/src/shared/domain/dev/project-files.ts +1 -15
- package/src/shared/domain/dev/prompts/brief-blocks.ts +20 -0
- package/src/shared/domain/dev/{review-prompt.ts → prompts.ts} +91 -61
- package/src/shared/domain/dev/questions.ts +33 -15
- package/src/shared/domain/dev/repo-pack.ts +12 -9
- package/src/shared/domain/dev/review-answer.ts +40 -17
- package/src/shared/domain/dev/review-brief.ts +54 -0
- package/src/shared/domain/dev/reviewer-charter.ts +4 -0
- package/src/shared/domain/dev/sheet-facts.ts +2 -4
- package/src/shared/domain/dev/spec-format.ts +13 -14
- package/src/shared/domain/dev/step-budget.ts +4 -2
- package/src/shared/domain/dev/step-rules.ts +3 -4
- package/src/shared/domain/dev/test-commands.ts +14 -10
- package/src/shared/domain/dev/tool-guards.ts +4 -3
- package/src/shared/domain/dev/trait-pattern.ts +14 -10
- package/src/shared/domain/dev/verdict-format.ts +14 -21
- package/src/shared/domain/dev/whitespace.ts +3 -2
- package/src/shared/domain/dev/work-folder.ts +6 -4
- package/src/shared/domain/dev/yaml-subset.ts +8 -26
- package/src/shared/domain/error-text.ts +13 -0
- package/src/shared/domain/git/close.ts +14 -11
- package/src/shared/domain/git/messages.ts +41 -0
- package/src/shared/domain/git/pull-request.ts +5 -5
- package/src/shared/domain/host-layout.ts +147 -0
- package/src/shared/domain/host-paths.ts +399 -0
- package/src/shared/domain/llm-failure.ts +35 -7
- package/src/shared/domain/llm-profile.ts +22 -3
- package/src/shared/domain/marked-message.ts +1 -5
- package/src/shared/domain/markers.ts +30 -0
- package/src/shared/domain/messages.ts +291 -0
- package/src/shared/domain/model-catalog.ts +2 -9
- package/src/shared/domain/permission-modes.ts +4 -8
- package/src/shared/domain/prelude.ts +2 -2
- package/src/shared/domain/project-manifests.ts +3 -2
- package/src/shared/domain/prompts.ts +233 -0
- package/src/shared/domain/search-routing.ts +3 -11
- package/src/shared/domain/secret-patterns.ts +3 -2
- package/src/shared/domain/session-keys.ts +7 -0
- package/src/shared/domain/session-start.ts +3 -2
- package/src/shared/domain/shared-memory/agent-memory-import.ts +4 -2
- package/src/shared/domain/shared-memory/candidates.ts +3 -4
- package/src/shared/domain/shared-memory/entry.ts +26 -20
- package/src/shared/domain/shared-memory/front-matter.ts +17 -13
- package/src/shared/domain/shared-memory/gate.ts +4 -3
- package/src/shared/domain/shared-memory/harvest.ts +9 -6
- package/src/shared/domain/shared-memory/layout.ts +11 -8
- package/src/shared/domain/shared-memory/markers.ts +9 -0
- package/src/shared/domain/shared-memory/messages.ts +66 -0
- package/src/shared/domain/shared-memory/precedents-block.ts +4 -15
- package/src/shared/domain/shared-memory/prompts.ts +28 -0
- package/src/shared/domain/shared-memory/refused.ts +3 -3
- package/src/shared/domain/skills/prompts.ts +4 -0
- package/src/shared/domain/skills/shortlist.ts +149 -0
- package/src/shared/domain/snip-turns.ts +2 -14
- package/src/shared/domain/speech.ts +2 -1
- package/src/shared/domain/tool-trace.ts +5 -7
- package/src/shared/domain/verifiers.ts +7 -11
- package/src/shared/domain/vfs.ts +8 -1
- package/src/shared/domain/workflow/prompts.ts +15 -0
- package/src/shared/domain/workflow/state-file.ts +14 -12
- package/src/shared/infrastructure/globals.ts +7 -2
- package/src/shared/infrastructure/orkeon/child-agents.ts +11 -16
- package/src/shared/infrastructure/orkeon/chooser.ts +32 -0
- package/src/shared/infrastructure/orkeon/decision-model.ts +31 -0
- package/src/shared/infrastructure/orkeon/dev-deps.ts +21 -14
- package/src/shared/infrastructure/orkeon/files.ts +24 -6
- package/src/shared/infrastructure/orkeon/github-pull-requests.ts +3 -2
- package/src/shared/infrastructure/orkeon/host-context.ts +36 -0
- package/src/shared/infrastructure/orkeon/human-input.ts +1 -5
- package/src/shared/infrastructure/orkeon/llm-profile.ts +36 -16
- package/src/shared/infrastructure/orkeon/llm.ts +85 -30
- package/src/shared/infrastructure/orkeon/markers.ts +6 -0
- package/src/shared/infrastructure/orkeon/memory-store.ts +1 -1
- package/src/shared/infrastructure/orkeon/memory-tools.ts +18 -20
- package/src/shared/infrastructure/orkeon/messages.ts +15 -0
- package/src/shared/infrastructure/orkeon/prompts.ts +47 -0
- package/src/shared/infrastructure/orkeon/reasoning.ts +40 -0
- package/src/shared/infrastructure/orkeon/script-tools.ts +14 -19
- package/src/shared/infrastructure/orkeon/session-store.ts +7 -51
- package/src/shared/infrastructure/orkeon/shell-jobs.ts +13 -7
- package/src/shared/infrastructure/orkeon/shell.ts +13 -5
- package/src/shared/infrastructure/orkeon/tool-catalogue.ts +3 -2
- package/src/shared/infrastructure/orkeon/wiring.ts +68 -12
- package/src/crews/dev-learn/application/learn-prompt.ts +0 -140
- package/src/crews/dev-verify/application/auditor-prompt.ts +0 -323
- package/src/shared/domain/session-summary.ts +0 -13
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
// without format problems, a sheet for every batch not done, an order the dependencies allow, git's
|
|
3
3
|
// identity (each batch's close commits) and a current branch. A ✗ stops the run before any launch; a
|
|
4
4
|
// tree changed outside the work folder and `.orkeon/` is a ⚠ only (a close commits the files its batch
|
|
5
|
-
// touched, by name)
|
|
5
|
+
// touched, by name), and so is a status git could not give, never read as a clean tree. The plan's facts
|
|
6
|
+
// come read; git is asked here.
|
|
6
7
|
import type { Shell } from "../ports.ts";
|
|
7
|
-
import { readIdentity, runGit } from "../git/commit-files.ts";
|
|
8
|
+
import { gitReason, readIdentity, runGit } from "../git/commit-files.ts";
|
|
8
9
|
import { GIT_CURRENT_BRANCH_COMMAND, GIT_STATUS_COMMAND, changedPaths } from "../../domain/git/close.ts";
|
|
10
|
+
import {
|
|
11
|
+
BRANCH_NONE, PLAN_NONE, SHEETS_OK, changesOutsideWorkFolder, identityMissing, identityOk, noSheetFor, treeStatusFailed,
|
|
12
|
+
} from "./messages.ts";
|
|
9
13
|
|
|
10
14
|
export interface PreflightInput {
|
|
11
15
|
/** The plan as the user reads it, `workbench/demo/DEMO-PLAN.md`; null when the code has none. */
|
|
@@ -34,12 +38,12 @@ export async function preflight(deps: { shell: Pick<Shell, "run"> }, input: Pref
|
|
|
34
38
|
let ok = true;
|
|
35
39
|
const fail = (line: string): void => { ok = false; lines.push(`preflight ✗ ${line}`); };
|
|
36
40
|
|
|
37
|
-
if (input.planShown === null) fail(
|
|
41
|
+
if (input.planShown === null) fail(PLAN_NONE);
|
|
38
42
|
else if (input.problems.length > 0) fail(`plan: ${input.problems.length} format problem(s): ${listed(input.problems)}`);
|
|
39
43
|
else lines.push(`preflight ✓ plan: ${input.planShown} (${input.batches} batch(es))`);
|
|
40
44
|
|
|
41
|
-
if (input.missingSheets.length > 0) fail(
|
|
42
|
-
else lines.push(
|
|
45
|
+
if (input.missingSheets.length > 0) fail(noSheetFor(input.missingSheets.join(", ")));
|
|
46
|
+
else lines.push(SHEETS_OK);
|
|
43
47
|
|
|
44
48
|
if (!input.order.ok) fail(`order: ${input.order.problem}`);
|
|
45
49
|
else lines.push(`preflight ✓ order: ${input.order.order.join(" → ") || "(no batch)"}`);
|
|
@@ -48,23 +52,24 @@ export async function preflight(deps: { shell: Pick<Shell, "run"> }, input: Pref
|
|
|
48
52
|
// A Bubblewrap shell runs with HOME=/tmp and a cleared environment: only the repository's own
|
|
49
53
|
// configuration reaches git there, so the hint names it.
|
|
50
54
|
if (!identity.ok) {
|
|
51
|
-
fail(
|
|
52
|
-
"(a confined shell reads no --global file)");
|
|
55
|
+
fail(identityMissing(identity.detail));
|
|
53
56
|
}
|
|
54
|
-
else lines.push(
|
|
57
|
+
else lines.push(identityOk(identity.ident.name, identity.ident.email));
|
|
55
58
|
|
|
56
59
|
const branch = await runGit(deps.shell, GIT_CURRENT_BRANCH_COMMAND);
|
|
57
60
|
const name = branch.exitCode === 0 ? branch.stdout.trim() : "";
|
|
58
|
-
if (name === "") fail(
|
|
61
|
+
if (name === "") fail(BRANCH_NONE);
|
|
59
62
|
else lines.push(`preflight ✓ branch: ${name}`);
|
|
60
63
|
|
|
61
64
|
const status = await runGit(deps.shell, GIT_STATUS_COMMAND);
|
|
62
|
-
if (status.exitCode
|
|
65
|
+
if (status.exitCode !== 0) {
|
|
66
|
+
lines.push(treeStatusFailed(gitReason(status)));
|
|
67
|
+
} else {
|
|
63
68
|
const work = input.workFolder.replace(/\/+$/, "");
|
|
64
69
|
const own = (p: string): boolean => p === work || p.startsWith(`${work}/`) || p.startsWith(".orkeon/");
|
|
65
70
|
const others = changedPaths(status.stdout).filter((p) => !own(p));
|
|
66
71
|
if (others.length > 0) {
|
|
67
|
-
lines.push(
|
|
72
|
+
lines.push(changesOutsideWorkFolder(others.length, listed(others)));
|
|
68
73
|
}
|
|
69
74
|
}
|
|
70
75
|
return { ok, lines };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// The text the dev services hand to the model: the refusals of a tool call (the guard, the hooks, the budget, a
|
|
2
|
+
// restore), the notes on the access cost an auditor reads, and the inventory of a draft brief.
|
|
3
|
+
|
|
4
|
+
// tool-call-policy.ts, tool-callbacks.ts
|
|
5
|
+
export const MEMORY_GUARD = "refused by the shared memory's guard";
|
|
6
|
+
export const MEMORY_CONTEXT =
|
|
7
|
+
"The shared memory's candidates and entries are written by memory_push and /memory-admit only: do without this call.";
|
|
8
|
+
export const hookMountCheckDeny = (step: string, text: string): string =>
|
|
9
|
+
`${step}: ${text}\nThe call did not run: a hook's command line may name no path its ` +
|
|
10
|
+
"program may not write; ask the user to change the hook.";
|
|
11
|
+
export const hookRefusedDeny = (step: string, text: string): string =>
|
|
12
|
+
`${step}: refused by ${text}\nThe call did not run: change it, or ask the user to fix the hook.`;
|
|
13
|
+
export const callbackFailed = (step: string, reason: string): string => `${step}: the callback failed: ${reason}`;
|
|
14
|
+
export const memoryGuardFailed = (reason: string): string => `the shared memory's guard failed: ${reason}`;
|
|
15
|
+
export const mountCheckRefusedHook = (label: string, denial: string): string =>
|
|
16
|
+
`the runtime's mount check refused the command line of ${label}, which did not run: ${denial}`;
|
|
17
|
+
|
|
18
|
+
// spend.ts, wrapped-tools.ts
|
|
19
|
+
export const budgetSpent = (limit: number): string =>
|
|
20
|
+
`budget: this batch has spent its ${limit} tool calls; end the act and say what is left`;
|
|
21
|
+
export const lookupsSpent = (limit: number): string =>
|
|
22
|
+
`review: your ${limit} look-ups are spent; open nothing more and write your findings now, from what you read: ` +
|
|
23
|
+
"CLEAR, or each question with its severity, evidence and target";
|
|
24
|
+
export const noRoleRestores = (command: string): string => `'${command}' restores: no role restores, the step did it once`;
|
|
25
|
+
|
|
26
|
+
// measure-access-cost.ts
|
|
27
|
+
export const toolFailedJudgeFromDiff = (tool: string, reason: string): string =>
|
|
28
|
+
`${tool} failed (${reason}); judge the Cost axis from the diff`;
|
|
29
|
+
export const reindexErrorJudgeFromDiff = (error: string): string => `incremental_reindex: ${error}; judge the Cost axis from the diff`;
|
|
30
|
+
export const accessCostErrorJudgeFromDiff = (error: string): string => `access_cost: ${error}; judge the Cost axis from the diff`;
|
|
31
|
+
export const NO_READABLE_REPORT = "access_cost returned no readable report; judge the Cost axis from the diff";
|
|
32
|
+
|
|
33
|
+
// brief-inventory.ts
|
|
34
|
+
export const INDEX_FOUND_NOTHING = "(the index found nothing for this request)";
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
// One round of questions on a written spec or change brief: the questions asked one at a time (settleQuestions),
|
|
2
2
|
// the file's open-questions and decisions sections rewritten and written after each answer, then - when anything
|
|
3
|
-
// was decided - one fold: the caller's model call rewrites the body with the decisions,
|
|
4
|
-
//
|
|
3
|
+
// was decided and the caller gave a fold - one fold: the caller's model call rewrites the body with the decisions,
|
|
4
|
+
// and the folded file is written (foldDecisions). A caller that gives none folds itself, once, when its rounds are
|
|
5
|
+
// over. A fold that fails leaves the decisions recorded in their section and says so in a warning: an answer a
|
|
5
6
|
// person gave is never lost.
|
|
6
7
|
import type { HumanInput } from "../ports.ts";
|
|
7
8
|
import { withQuestionSections } from "../../domain/dev/questions.ts";
|
|
8
9
|
import type { Decision, Question } from "../../domain/dev/questions.ts";
|
|
9
10
|
import { settleQuestions } from "./settle-questions.ts";
|
|
11
|
+
import { REWRITE_REFUSED, decisionsNotFolded } from "./messages.ts";
|
|
10
12
|
|
|
11
13
|
export interface RoundState { text: string; open: Question[]; decisions: Decision[] }
|
|
12
14
|
export type Folded = { ok: true; text: string; open: Question[] } | { ok: false; problems: string[] };
|
|
13
15
|
|
|
16
|
+
export type Fold = (state: RoundState, fresh: readonly Decision[]) => Promise<Folded>;
|
|
17
|
+
|
|
14
18
|
export interface RoundDeps {
|
|
15
19
|
human: HumanInput;
|
|
16
20
|
today: string;
|
|
@@ -19,8 +23,9 @@ export interface RoundDeps {
|
|
|
19
23
|
/** The headings the two sections are written under ("## 12. Open questions", "## 13. Decisions"). */
|
|
20
24
|
headings: { questions: string; decisions: string };
|
|
21
25
|
write: (text: string) => Promise<void>;
|
|
22
|
-
/** Rewrites the body with the decisions of the round; `open` are the questions still open.
|
|
23
|
-
|
|
26
|
+
/** Rewrites the body with the decisions of the round; `open` are the questions still open. Absent: the round
|
|
27
|
+
* records the answers and rewrites nothing. */
|
|
28
|
+
fold?: Fold;
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
export interface RoundOutcome { state: RoundState; made: Decision[]; blocked: boolean; warnings: string[] }
|
|
@@ -36,17 +41,20 @@ export async function questionRound(
|
|
|
36
41
|
await deps.write(text);
|
|
37
42
|
},
|
|
38
43
|
}, which);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
44
|
+
const next: RoundState = { text, open: settled.open, decisions: settled.decisions };
|
|
45
|
+
if (deps.fold === undefined) return { state: next, made: settled.made, blocked: settled.blocked, warnings: [] };
|
|
46
|
+
const folded = await foldDecisions(next, settled.made, deps.fold, deps.write);
|
|
47
|
+
return { state: folded.state, made: settled.made, blocked: settled.blocked, warnings: folded.warnings };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** One fold of `made` into the body of `state`, the folded file written: nothing to do when nothing was decided, a
|
|
51
|
+
* warning and the state as it was when the rewrite is refused. */
|
|
52
|
+
export async function foldDecisions(
|
|
53
|
+
state: RoundState, made: readonly Decision[], fold: Fold, write: (text: string) => Promise<void>,
|
|
54
|
+
): Promise<{ state: RoundState; warnings: string[] }> {
|
|
55
|
+
if (made.length === 0) return { state, warnings: [] };
|
|
56
|
+
const folded = await fold(state, made);
|
|
57
|
+
if (!folded.ok) return { state, warnings: [decisionsNotFolded(folded.problems[0] ?? REWRITE_REFUSED)] };
|
|
58
|
+
await write(folded.text);
|
|
59
|
+
return { state: { ...state, text: folded.text, open: folded.open }, warnings: [] };
|
|
52
60
|
}
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
DEFAULT_WORK_FOLDER, isSamePath, mainWorktreeOf, normalizeWorkDir,
|
|
12
12
|
} from "../../domain/dev/work-folder.ts";
|
|
13
13
|
import { WORKSPACE } from "../../domain/vfs.ts";
|
|
14
|
+
import { absentFromCheckout, linkedWorktreeNote, notARelativeFolderFallback } from "./messages.ts";
|
|
14
15
|
|
|
15
16
|
export const GIT_WORKTREE_LIST = "git worktree list --porcelain";
|
|
16
17
|
export const GIT_TOPLEVEL = "git rev-parse --show-toplevel";
|
|
@@ -88,7 +89,7 @@ export async function resolveWorkFolder(
|
|
|
88
89
|
const check = normalizeWorkDir(request.value);
|
|
89
90
|
if (!check.ok) {
|
|
90
91
|
return fallback("invalid",
|
|
91
|
-
|
|
92
|
+
notARelativeFolderFallback(request.source, request.value, check.reason, DEFAULT_WORK_FOLDER));
|
|
92
93
|
}
|
|
93
94
|
const value = check.folder;
|
|
94
95
|
if (value === "") return fallback("default", null);
|
|
@@ -101,7 +102,7 @@ export async function resolveWorkFolder(
|
|
|
101
102
|
return { folder: value, vfsPath, outcome: "applied", request, exists: true, note: null };
|
|
102
103
|
}
|
|
103
104
|
|
|
104
|
-
const absentNote =
|
|
105
|
+
const absentNote = absentFromCheckout(request.source, value, DEFAULT_WORK_FOLDER);
|
|
105
106
|
const porcelain = await gitStdout(deps.shell, GIT_WORKTREE_LIST);
|
|
106
107
|
const toplevel = await gitStdout(deps.shell, GIT_TOPLEVEL);
|
|
107
108
|
const main = porcelain === null ? null : mainWorktreeOf(porcelain);
|
|
@@ -118,7 +119,7 @@ export async function resolveWorkFolder(
|
|
|
118
119
|
outcome: "main-worktree",
|
|
119
120
|
request,
|
|
120
121
|
exists: true,
|
|
121
|
-
note:
|
|
122
|
+
note: linkedWorktreeNote(folder),
|
|
122
123
|
};
|
|
123
124
|
}
|
|
124
125
|
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
// before the next question is asked. When nobody answers (an unattended run, an empty text) the asking stops at
|
|
5
5
|
// once: nothing is decided on anyone's behalf, the questions stay in the file and the step reads BLOCKED.
|
|
6
6
|
import type { HumanInput } from "../ports.ts";
|
|
7
|
-
import {
|
|
7
|
+
import { askingOrder, decide, questionPrompt } from "../../domain/dev/questions.ts";
|
|
8
|
+
import { LEAVE_OPEN } from "../../domain/dev/markers.ts";
|
|
8
9
|
import type { Decision, Question } from "../../domain/dev/questions.ts";
|
|
10
|
+
import { EMPTY_ANSWER_LEAVES_OPEN } from "./messages.ts";
|
|
9
11
|
|
|
10
12
|
export interface SettleDeps {
|
|
11
13
|
human: HumanInput;
|
|
@@ -40,7 +42,7 @@ export async function settleQuestions(
|
|
|
40
42
|
if (!r.answered) return { open: left, decisions: all, made, blocked: true };
|
|
41
43
|
answer = r.value === LEAVE_OPEN ? null : r.value;
|
|
42
44
|
} else {
|
|
43
|
-
const r = await deps.human.text(`${prompt}
|
|
45
|
+
const r = await deps.human.text(`${prompt}${EMPTY_ANSWER_LEAVES_OPEN}`);
|
|
44
46
|
if (!r.answered) return { open: left, decisions: all, made, blocked: true };
|
|
45
47
|
answer = r.value;
|
|
46
48
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
// The read-only review of a written spec or change brief, once per run: the reviewer's sub-agent questions the
|
|
2
2
|
// file, and its rows join the open questions (a row asking what an open question or a decision already holds is
|
|
3
3
|
// not added), the file written again. The rows' ids are returned so the caller asks the Blocking ones.
|
|
4
|
-
import type { Llm } from "../ports.ts";
|
|
4
|
+
import type { Llm, Logger } from "../ports.ts";
|
|
5
5
|
import { runSubAgent } from "../agents/run-sub-agent.ts";
|
|
6
|
+
import type { ActRoute } from "../agents/route-agent.ts";
|
|
6
7
|
import { REVIEWER_CHARTER } from "../../domain/dev/reviewer-charter.ts";
|
|
7
|
-
import { REVIEW_ANSWER_SCHEMA,
|
|
8
|
+
import { REVIEW_ANSWER_SCHEMA, reviewChecks } from "../../domain/dev/review-answer.ts";
|
|
8
9
|
import type { ReviewAnswer } from "../../domain/dev/review-answer.ts";
|
|
9
|
-
import {
|
|
10
|
+
import { reviewSystem } from "../../domain/dev/prompts.ts";
|
|
11
|
+
import { buildReviewAnswerPrompt, buildReviewBrief } from "../../domain/dev/review-brief.ts";
|
|
10
12
|
import { numberQuestions, reviewDrafts, withQuestionSections } from "../../domain/dev/questions.ts";
|
|
11
13
|
import type { RoundState } from "./question-round.ts";
|
|
14
|
+
import { addedAsOpenQuestions, reviewCounts, reviewNotRun } from "./messages.ts";
|
|
12
15
|
|
|
13
16
|
export interface SourceReviewRequest {
|
|
14
17
|
mode: "spec" | "change";
|
|
@@ -28,6 +31,7 @@ export type SourceReviewOutcome =
|
|
|
28
31
|
|
|
29
32
|
export async function reviewSource(
|
|
30
33
|
llm: Pick<Llm, "act" | "extract">, state: RoundState, request: SourceReviewRequest, write: (text: string) => Promise<void>,
|
|
34
|
+
route?: ActRoute, log?: Pick<Logger, "info">,
|
|
31
35
|
): Promise<SourceReviewOutcome> {
|
|
32
36
|
const targets = [request.whole, ...request.ids];
|
|
33
37
|
const outcome = await runSubAgent(llm, {
|
|
@@ -39,8 +43,8 @@ export async function reviewSource(
|
|
|
39
43
|
}),
|
|
40
44
|
schema: REVIEW_ANSWER_SCHEMA,
|
|
41
45
|
answerPrompt: (reply, problems) => buildReviewAnswerPrompt(reply, problems, targets),
|
|
42
|
-
|
|
43
|
-
});
|
|
46
|
+
...reviewChecks(targets),
|
|
47
|
+
}, route, log);
|
|
44
48
|
if (!outcome.ok) return { ran: false, reason: `${outcome.reason}: ${outcome.problems[0] ?? "no detail"}` };
|
|
45
49
|
const review = outcome.value;
|
|
46
50
|
if (review.rows.length === 0) return { ran: true, review, state, added: [] };
|
|
@@ -54,10 +58,10 @@ export async function reviewSource(
|
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
export function reviewLine(outcome: SourceReviewOutcome): string {
|
|
57
|
-
if (!outcome.ran) return
|
|
61
|
+
if (!outcome.ran) return reviewNotRun(outcome.reason);
|
|
58
62
|
const rows = outcome.review.rows;
|
|
59
63
|
if (rows.length === 0) return `review: ${outcome.review.verdict}`;
|
|
60
64
|
const blocking = rows.filter((r) => r.severity === "Blocking").length;
|
|
61
|
-
const kept = outcome.added.length === rows.length ? "" :
|
|
62
|
-
return
|
|
65
|
+
const kept = outcome.added.length === rows.length ? "" : addedAsOpenQuestions(outcome.added.length);
|
|
66
|
+
return reviewCounts(outcome.review.verdict, blocking, rows.length - blocking, kept);
|
|
63
67
|
}
|
|
@@ -10,6 +10,8 @@ import type { Decision, Question } from "../../domain/dev/questions.ts";
|
|
|
10
10
|
import { parsePlanSource } from "../../domain/dev/spec-format.ts";
|
|
11
11
|
import type { SourceKind } from "../../domain/dev/spec-format.ts";
|
|
12
12
|
import { WORKSPACE } from "../../domain/vfs.ts";
|
|
13
|
+
import { DECISIONS_DO_NOT_READ_BACK, NO_WORK_TREE, idsReadBack, invalidCode, invalidInput, openQuestionsReadBack, outsideCheckout, runFromCheckout, titleDoesNotReadCode, workFolderOutsideCheckoutMounts } from "./messages.ts";
|
|
14
|
+
import { prefixedCannotBeRead as stepCannotRead } from "../messages.ts";
|
|
13
15
|
|
|
14
16
|
export const MAX_CODE_CHARS = 64;
|
|
15
17
|
export const MAX_REQUEST_CHARS = 20_000;
|
|
@@ -54,14 +56,14 @@ export function problemLines(problems: readonly string[]): string[] {
|
|
|
54
56
|
|
|
55
57
|
/** The code of the inputs, or the refusal. */
|
|
56
58
|
export function inputCode(step: string, value: unknown): string | { refused: string } {
|
|
57
|
-
if (typeof value !== "string" || value.length > MAX_CODE_CHARS || !isCode(value)) return { refused:
|
|
59
|
+
if (typeof value !== "string" || value.length > MAX_CODE_CHARS || !isCode(value)) return { refused: invalidCode(step) };
|
|
58
60
|
return value;
|
|
59
61
|
}
|
|
60
62
|
|
|
61
63
|
/** A free text input: "" when absent, the refusal when it is not a string or too long. */
|
|
62
64
|
export function inputText(step: string, name: string, value: unknown): string | { refused: string } {
|
|
63
65
|
if (value === undefined || value === null) return "";
|
|
64
|
-
if (typeof value !== "string" || value.length > MAX_REQUEST_CHARS) return { refused:
|
|
66
|
+
if (typeof value !== "string" || value.length > MAX_REQUEST_CHARS) return { refused: invalidInput(step, name) };
|
|
65
67
|
return value.trim();
|
|
66
68
|
}
|
|
67
69
|
|
|
@@ -74,7 +76,7 @@ export async function toplevelRefusal(step: string, shell: Pick<Shell, "run">):
|
|
|
74
76
|
top = "";
|
|
75
77
|
}
|
|
76
78
|
if (top === WORKSPACE) return null;
|
|
77
|
-
return
|
|
79
|
+
return runFromCheckout(step, WORKSPACE, top === "" ? NO_WORK_TREE : top);
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
export interface CodeFolder {
|
|
@@ -89,7 +91,7 @@ export interface CodeFolder {
|
|
|
89
91
|
/** The code's folder under the work folder and the names it holds ([] when it does not exist yet). */
|
|
90
92
|
export async function codeFolder(step: string, files: Pick<Files, "list">, work: WorkFolder, code: string): Promise<CodeFolder | { refused: string }> {
|
|
91
93
|
if (work.vfsPath === null) {
|
|
92
|
-
return { refused:
|
|
94
|
+
return { refused: workFolderOutsideCheckoutMounts(step, work.folder) };
|
|
93
95
|
}
|
|
94
96
|
const vfs = `${work.vfsPath}/${code}`;
|
|
95
97
|
const shown = `${work.folder}/${code}`;
|
|
@@ -110,14 +112,14 @@ export async function readRequest(step: string, files: Pick<Files, "read">, requ
|
|
|
110
112
|
if (!PATH_TOKEN.test(request)) return { text: request, from: "" };
|
|
111
113
|
const relative = request.startsWith(`${WORKSPACE}/`) ? request.slice(WORKSPACE.length + 1) : request.replace(/^\.\//, "");
|
|
112
114
|
if (relative.startsWith("/") || relative.split("/").includes("..")) {
|
|
113
|
-
return { refused:
|
|
115
|
+
return { refused: outsideCheckout(step, request, WORKSPACE) };
|
|
114
116
|
}
|
|
115
117
|
try {
|
|
116
118
|
const text = await files.read(`${WORKSPACE}/${relative}`, MAX_REQUEST_CHARS);
|
|
117
119
|
if (text.trim() === "") return { refused: `${step}: ${relative} is empty` };
|
|
118
120
|
return { text, from: relative };
|
|
119
121
|
} catch (e) {
|
|
120
|
-
return { refused:
|
|
122
|
+
return { refused: stepCannotRead(step, relative, firstLine(e)) };
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
125
|
|
|
@@ -130,15 +132,15 @@ export function sourceSelfCheck(
|
|
|
130
132
|
): string[] {
|
|
131
133
|
const parsed = parsePlanSource(text, kind);
|
|
132
134
|
const problems = parsed.problems.map((p) => `line ${p.line}: ${p.message}`);
|
|
133
|
-
if (parsed.code !== expect.code) problems.push(
|
|
135
|
+
if (parsed.code !== expect.code) problems.push(titleDoesNotReadCode(expect.code));
|
|
134
136
|
const read = parsed.ids.map((i) => i.id).join(",");
|
|
135
137
|
if (read !== expect.ids.join(",")) {
|
|
136
|
-
problems.push(
|
|
138
|
+
problems.push(idsReadBack(read || "none", expect.ids.join(",")));
|
|
137
139
|
}
|
|
138
140
|
if (parsed.openQuestions.length !== expect.open.length) {
|
|
139
|
-
problems.push(
|
|
141
|
+
problems.push(openQuestionsReadBack(parsed.openQuestions.length, expect.open.length));
|
|
140
142
|
}
|
|
141
|
-
if (parseDecisions(text).length !== expect.decisions.length) problems.push(
|
|
143
|
+
if (parseDecisions(text).length !== expect.decisions.length) problems.push(DECISIONS_DO_NOT_READ_BACK);
|
|
142
144
|
return problems;
|
|
143
145
|
}
|
|
144
146
|
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// A batch's budget of tool calls: the runtime gives a delegated agent no budget (L8P-D12), so a parallel
|
|
2
2
|
// /dev-batches' batch agent counts its own calls and its callbacks refuse every call past the bound.
|
|
3
3
|
import type { ToolCallbacks } from "./tool-callbacks.ts";
|
|
4
|
+
import { REVIEWER_LOOKUPS } from "../../domain/dev/reviewer-charter.ts";
|
|
5
|
+
import { budgetSpent, lookupsSpent } from "./prompts.ts";
|
|
4
6
|
|
|
5
7
|
/** A batch's tool calls: counted, and refused once `limit` is reached. A call to a tool the act does not offer is
|
|
6
|
-
* refused by the runtime before `onToolCall` (Orkeon #193): it costs nothing here, the act's `maxIterations` bounds it.
|
|
8
|
+
* refused by the runtime before `onToolCall` (Orkeon #193): it costs nothing here, the act's `maxIterations` bounds it.
|
|
9
|
+
* A call the host's gate refuses is counted: the gate judges after `onToolCall` (Orkeon #303). */
|
|
7
10
|
export interface Spend {
|
|
8
11
|
readonly limit: number;
|
|
9
12
|
calls(): number;
|
|
@@ -24,8 +27,11 @@ export function createSpend(limit: number): Spend {
|
|
|
24
27
|
};
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
/** `callbacks` denying every call past the spend's limit
|
|
28
|
-
|
|
30
|
+
/** `callbacks` denying every call past the spend's limit with what `spent` says of it (a batch's budget when not
|
|
31
|
+
* given); `callbacks` themselves without a spend. */
|
|
32
|
+
export function spendGuard<C extends Pick<ToolCallbacks, "forAct">>(
|
|
33
|
+
callbacks: C, spend: Spend | undefined, spent: (limit: number) => string = budgetSpent,
|
|
34
|
+
): C {
|
|
29
35
|
if (spend === undefined) return callbacks;
|
|
30
36
|
return {
|
|
31
37
|
...callbacks,
|
|
@@ -35,8 +41,15 @@ export function spendGuard<C extends Pick<ToolCallbacks, "forAct">>(callbacks: C
|
|
|
35
41
|
...inner,
|
|
36
42
|
onToolCall: async (call) => (spend.take()
|
|
37
43
|
? inner.onToolCall(call)
|
|
38
|
-
: { deny:
|
|
44
|
+
: { deny: spent(spend.limit) }),
|
|
39
45
|
};
|
|
40
46
|
},
|
|
41
47
|
};
|
|
42
48
|
}
|
|
49
|
+
|
|
50
|
+
/** The callbacks of one act of the reviewer of a plan, a spec or a brief: `callbacks` under a fresh spend of
|
|
51
|
+
* REVIEWER_LOOKUPS calls, a call past it refused with the order to write the findings. One spend per act: call it
|
|
52
|
+
* once for each. */
|
|
53
|
+
export function reviewerCallbacks<C extends Pick<ToolCallbacks, "forAct">>(callbacks: C): C {
|
|
54
|
+
return spendGuard(callbacks, createSpend(REVIEWER_LOOKUPS), lookupsSpent);
|
|
55
|
+
}
|
|
@@ -11,6 +11,7 @@ import { buildPrecedentsBlock } from "../../domain/shared-memory/precedents-bloc
|
|
|
11
11
|
import { recallEntries } from "../shared-memory/recall-precedents.ts";
|
|
12
12
|
import { readMemorySettings } from "../shared-memory/memory-settings.ts";
|
|
13
13
|
import type { MemorySettings } from "../shared-memory/memory-settings.ts";
|
|
14
|
+
import { namedRecallFailed } from "./messages.ts";
|
|
14
15
|
|
|
15
16
|
/** T1 spec or change start, T2 plan start, T3 before a batch's red tests, T4 before the audit, T5 a correction. */
|
|
16
17
|
export type RecallTrigger = "T1" | "T2" | "T3" | "T4" | "T5";
|
|
@@ -76,7 +77,7 @@ export function stepPrecedents(deps: StepPrecedentsDeps, options: { on: boolean
|
|
|
76
77
|
return block === "" ? NOTHING_RECALLED : { block, ids: recall.precedents.map((p) => p.entry.id) };
|
|
77
78
|
} catch (error) {
|
|
78
79
|
settings = null; // a failed read is tried again at the next trigger, not kept for the run
|
|
79
|
-
deps.log.warn(
|
|
80
|
+
deps.log.warn(namedRecallFailed(trigger, firstLine(error)));
|
|
80
81
|
return NOTHING_RECALLED;
|
|
81
82
|
}
|
|
82
83
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// What a dev crew's onToolCall decides for one call the host's gate
|
|
1
|
+
// What a dev crew's onToolCall decides for one call, before the host's gate judges it, over probes the callbacks build
|
|
2
2
|
// (tool-callbacks.ts): the path resolved under the checkout first, then the shared memory's guard, then the crew's
|
|
3
3
|
// guard (shared/domain/dev/call-guard.ts) told whether a file_write under a rewrite rule names a new file, then the
|
|
4
4
|
// pre-tool hooks, stopped at the first that fails. It holds the order and the refusals' texts; what the probes read
|
|
@@ -9,6 +9,8 @@ import { resolvePathInput } from "../../domain/dev/path-args.ts";
|
|
|
9
9
|
import { REWRITE_TOOL } from "../../domain/agent-policy/rule-sets.ts";
|
|
10
10
|
import { sameToolName } from "../../domain/agent-policy/permission.ts";
|
|
11
11
|
import { memoryWriteRefusal } from "../../domain/shared-memory/layout.ts";
|
|
12
|
+
import { MEMORY_CONTEXT, MEMORY_GUARD, callbackFailed, hookMountCheckDeny, hookRefusedDeny } from "./prompts.ts";
|
|
13
|
+
import { mountCheckRefusedPreHook, preHookRefused, relativePathResolved } from "./messages.ts";
|
|
12
14
|
|
|
13
15
|
/** The runtime's verdict and result callbacks, as ActOptions types them (the subset the callbacks return): allow,
|
|
14
16
|
* deny, or allow with the call's input rewritten (a relative path resolved). */
|
|
@@ -31,9 +33,6 @@ export interface CallProbes {
|
|
|
31
33
|
/** The verdict, and the lines the callbacks log for it (at info). */
|
|
32
34
|
export interface CallJudgement { verdict: ToolCallVerdict; notes: string[] }
|
|
33
35
|
|
|
34
|
-
const MEMORY_GUARD = "refused by the shared memory's guard";
|
|
35
|
-
const MEMORY_CONTEXT = "The shared memory's candidates and entries are written by memory_push and /memory-admit only: do without this call.";
|
|
36
|
-
|
|
37
36
|
/** The refusal of a write into the shared memory, `why` its reason (memoryWriteRefusal), without a step's name. */
|
|
38
37
|
export function memoryDenyText(why: string): string {
|
|
39
38
|
return `${MEMORY_GUARD}: ${why}\n${MEMORY_CONTEXT}`;
|
|
@@ -42,9 +41,8 @@ export function memoryDenyText(why: string): string {
|
|
|
42
41
|
/** The refusal of a call a pre-tool hook stopped, led by the step's name. */
|
|
43
42
|
function hookDenyText(step: string, failure: HookFailure): string {
|
|
44
43
|
return failure.by === "mount-check"
|
|
45
|
-
?
|
|
46
|
-
|
|
47
|
-
: `${step}: refused by ${failure.text}\nThe call did not run: change it, or ask the user to fix the hook.`;
|
|
44
|
+
? hookMountCheckDeny(step, failure.text)
|
|
45
|
+
: hookRefusedDeny(step, failure.text);
|
|
48
46
|
}
|
|
49
47
|
|
|
50
48
|
export async function judgeToolCall(
|
|
@@ -58,7 +56,7 @@ export async function judgeToolCall(
|
|
|
58
56
|
// (the runtime would resolve it too, after the guard: too late for the rules and the hooks).
|
|
59
57
|
const resolved = resolvePathInput(call.name, call.input);
|
|
60
58
|
const input = resolved ?? call.input;
|
|
61
|
-
if (resolved !== null) notes.push(
|
|
59
|
+
if (resolved !== null) notes.push(relativePathResolved(guard.step, call.name));
|
|
62
60
|
const dir = await probes.memoryDir();
|
|
63
61
|
const memory = dir === null ? null : memoryWriteRefusal(dir, call.name, input);
|
|
64
62
|
if (memory !== null) {
|
|
@@ -78,12 +76,12 @@ export async function judgeToolCall(
|
|
|
78
76
|
const failed = await probes.runHook(hook, call.name, input);
|
|
79
77
|
if (failed === undefined) continue;
|
|
80
78
|
notes.push(failed.by === "mount-check"
|
|
81
|
-
?
|
|
82
|
-
:
|
|
79
|
+
? mountCheckRefusedPreHook(guard.step, hook.n, call.name)
|
|
80
|
+
: preHookRefused(guard.step, hook.n, call.name));
|
|
83
81
|
return judged({ deny: hookDenyText(guard.step, failed) });
|
|
84
82
|
}
|
|
85
83
|
return judged(resolved === null ? "allow" : { input: resolved });
|
|
86
84
|
} catch (e) {
|
|
87
|
-
return judged({ deny:
|
|
85
|
+
return judged({ deny: callbackFailed(guard.step, String((e as Error)?.message ?? e)) });
|
|
88
86
|
}
|
|
89
87
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// The dev crews' onToolCall and onToolResult (RT-04), built from a crew's inputs and handed to every act through
|
|
2
|
-
//
|
|
2
|
+
// agentLlm(ctx, callbacks). The callback runs before the host's gate, which judges the input it returns (Orkeon #303): the
|
|
3
3
|
// callback hands the call to the decision (tool-call-policy.ts) over probes built here: the memory folder read
|
|
4
4
|
// once, the path a file_write under a rewrite rule names read once (a file the runtime says is not found is a new
|
|
5
5
|
// one, which file_write may create), and the hooks run in the shell; it logs the decision's notes. After the call,
|
|
@@ -13,12 +13,19 @@ import { OPERATIONS_TOOL } from "../../domain/agent-policy/rule-sets.ts";
|
|
|
13
13
|
import { sameToolName } from "../../domain/agent-policy/permission.ts";
|
|
14
14
|
import { memoryWriteRefusal } from "../../domain/shared-memory/layout.ts";
|
|
15
15
|
import { mapStrings, textFromRoot } from "../../domain/dev/path-rebase.ts";
|
|
16
|
+
import { callToVirtual, textToVirtual } from "../../domain/host-paths.ts";
|
|
17
|
+
import { pathListRefusal } from "../../domain/agent-policy/path-rules.ts";
|
|
18
|
+
import { isIdentityContext } from "../host-context.ts";
|
|
19
|
+
import type { HostContext } from "../host-context.ts";
|
|
16
20
|
import type { CallGuard, CallGuardSpec, ToolHook } from "../../domain/dev/call-guard.ts";
|
|
17
21
|
import { WORKSPACE } from "../../domain/vfs.ts";
|
|
18
22
|
import { judgeToolCall, memoryDenyText } from "./tool-call-policy.ts";
|
|
19
23
|
import type { CallProbes, HookFailure, ToolCallVerdict } from "./tool-call-policy.ts";
|
|
20
24
|
|
|
21
25
|
export type { HookFailure, ToolCallVerdict } from "./tool-call-policy.ts";
|
|
26
|
+
import { memoryGuardFailed, mountCheckRefusedHook } from "./prompts.ts";
|
|
27
|
+
import { couldNotRun as hookCouldNotRun } from "../messages.ts";
|
|
28
|
+
import { postHooksFailed } from "./messages.ts";
|
|
22
29
|
|
|
23
30
|
/** A hook is stopped after this many seconds, and refuses (pre) or is reported (post). */
|
|
24
31
|
export const HOOK_TIMEOUT_SECONDS = 60;
|
|
@@ -62,7 +69,7 @@ export function memoryGuardCallbacks(memoryDir: () => Promise<string>): Pick<Too
|
|
|
62
69
|
const why = memoryWriteRefusal(await dir(), call.name, call.input);
|
|
63
70
|
return why === null ? "allow" : { deny: memoryDenyText(why) };
|
|
64
71
|
} catch (e) {
|
|
65
|
-
return { deny:
|
|
72
|
+
return { deny: memoryGuardFailed(String((e as Error)?.message ?? e)) };
|
|
66
73
|
}
|
|
67
74
|
},
|
|
68
75
|
async onToolResult() { return undefined; },
|
|
@@ -119,7 +126,7 @@ async function runHook(deps: ToolCallbackDeps, hook: ToolHook, tool: string, inp
|
|
|
119
126
|
const command = hookCommand(hook, tool, input);
|
|
120
127
|
const label = `${hook.event} hook #${hook.n} (${command})`;
|
|
121
128
|
const refused = (denial: string): HookFailure =>
|
|
122
|
-
({ by: "mount-check", text:
|
|
129
|
+
({ by: "mount-check", text: mountCheckRefusedHook(label, denial) });
|
|
123
130
|
try {
|
|
124
131
|
const r = await deps.shell.run(command, { timeoutSeconds: HOOK_TIMEOUT_SECONDS });
|
|
125
132
|
// A refused command line comes back not completed: read as a timeout, it would hide the refusal.
|
|
@@ -133,7 +140,7 @@ async function runHook(deps: ToolCallbackDeps, hook: ToolHook, tool: string, inp
|
|
|
133
140
|
const message = String((e as Error)?.message ?? e);
|
|
134
141
|
const denial = mountDenial(message);
|
|
135
142
|
if (denial !== null) return refused(denial);
|
|
136
|
-
return { by: "hook", text:
|
|
143
|
+
return { by: "hook", text: hookCouldNotRun(label, message.split("\n")[0]) };
|
|
137
144
|
}
|
|
138
145
|
}
|
|
139
146
|
|
|
@@ -173,7 +180,7 @@ export function createToolCallbacks(guard: CallGuard, deps: ToolCallbackDeps): T
|
|
|
173
180
|
if (failed !== undefined) notes.push(`[${failed.text}]`);
|
|
174
181
|
}
|
|
175
182
|
if (notes.length === 0) return undefined;
|
|
176
|
-
deps.log?.warn(
|
|
183
|
+
deps.log?.warn(postHooksFailed(guard.step, notes.length, call.name));
|
|
177
184
|
return { context: [shownText(result), ...notes].join("\n") };
|
|
178
185
|
},
|
|
179
186
|
};
|
|
@@ -213,3 +220,43 @@ export function rootedCallbacks<C extends Pick<ToolCallbacks, "forAct">>(callbac
|
|
|
213
220
|
},
|
|
214
221
|
};
|
|
215
222
|
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* The outermost layer of every act's callbacks (createLlm wraps each act in it): the host's spellings and the
|
|
226
|
+
* user's path lists. Before the call, its path fields and its command are brought back to the canonical virtual
|
|
227
|
+
* spelling (host-paths.ts callToVirtual), the lists judge that spelling (path-rules.ts pathListRefusal), then
|
|
228
|
+
* `inner` sees the canonical call: an inner refusal stands; an inner `{ input }` is kept, canonicalised once more;
|
|
229
|
+
* an inner allow becomes `{ input }` when the spelling changed, so the runtime gates and runs the canonical call.
|
|
230
|
+
* After the call, every string of the result is read with its physical spellings canonicalised (textToVirtual)
|
|
231
|
+
* before `inner` sees it; an inner `{ context }` is canonicalised too; a result the spellings changed replaces
|
|
232
|
+
* what the model reads. The identity context (a posix host without mounts, no list) leaves `inner` as it is.
|
|
233
|
+
*/
|
|
234
|
+
export function hostCallbacks(inner: ActCallbacks | undefined, host: HostContext): ActCallbacks | undefined {
|
|
235
|
+
if (isIdentityContext(host)) return inner;
|
|
236
|
+
const { layout, lists } = host;
|
|
237
|
+
const canonicalInput = (name: string, input: unknown): unknown => callToVirtual(name, input, layout) ?? input;
|
|
238
|
+
return {
|
|
239
|
+
async onToolCall(call): Promise<ToolCallVerdict> {
|
|
240
|
+
const input = canonicalInput(call.name, call.input);
|
|
241
|
+
const why = pathListRefusal(lists, layout, call.name, input);
|
|
242
|
+
if (why !== null) return { deny: why };
|
|
243
|
+
const changed = input !== call.input;
|
|
244
|
+
if (inner === undefined) return changed ? { input } : "allow";
|
|
245
|
+
const verdict = await inner.onToolCall({ name: call.name, input });
|
|
246
|
+
if (typeof verdict === "object" && "deny" in verdict) return verdict;
|
|
247
|
+
if (typeof verdict === "object" && "input" in verdict) return { input: canonicalInput(call.name, verdict.input) };
|
|
248
|
+
return changed ? { input } : verdict;
|
|
249
|
+
},
|
|
250
|
+
async onToolResult(call, result) {
|
|
251
|
+
const mapped = mapStrings(result, (text) => textToVirtual(text, layout));
|
|
252
|
+
const shown = shownText(mapped);
|
|
253
|
+
const changed = shown !== shownText(result);
|
|
254
|
+
if (inner === undefined) return changed ? { context: shown } : undefined;
|
|
255
|
+
const answer = await inner.onToolResult({ name: call.name, input: canonicalInput(call.name, call.input) }, mapped);
|
|
256
|
+
if (answer !== undefined && answer !== null && typeof answer === "object" && typeof answer.context === "string") {
|
|
257
|
+
return { context: textToVirtual(answer.context, layout) };
|
|
258
|
+
}
|
|
259
|
+
return changed ? { context: shown } : undefined;
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
}
|
|
@@ -22,7 +22,8 @@ export function createToolTrace(): ToolTrace {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** The callbacks given, each result recorded first, and each call they deny, which gets no result: their verdicts
|
|
25
|
-
* and their context stand unchanged. A call the host's gate refuses
|
|
25
|
+
* and their context stand unchanged. A call the host's gate refuses after `onToolCall` (Orkeon #303) comes back as a `DENIED:` result through the
|
|
26
|
+
* host's invocation pipeline, recorded like any other; one the callback denies gets no result. */
|
|
26
27
|
export function tracedCallbacks(inner: Pick<ToolCallbacks, "forAct">, trace: Pick<ToolTrace, "record">): Pick<ToolCallbacks, "forAct"> {
|
|
27
28
|
return {
|
|
28
29
|
forAct(mode, gateEnabled) {
|