ace-swarm 2.1.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/assets/.agents/ACE/AGENT_REGISTRY.md +7 -1
  2. package/assets/.agents/ACE/agent-eval/instructions.md +41 -1
  3. package/assets/.agents/ACE/agent-memory/instructions.md +35 -1
  4. package/assets/.agents/ACE/agent-observability/instructions.md +35 -1
  5. package/assets/.agents/ACE/agent-release/instructions.md +34 -1
  6. package/assets/.agents/ACE/agent-security/instructions.md +35 -1
  7. package/assets/.agents/ACE/agent-skeptic/instructions.md +49 -0
  8. package/assets/.agents/ACE/orchestrator/AGENTS.md +11 -0
  9. package/assets/.agents/skills/ace-orchestrator/SKILL.md +40 -337
  10. package/assets/.agents/skills/ace-orchestrator/references/engineering-bootstrap-playbook.md +360 -0
  11. package/assets/.agents/skills/astgrep-index/SKILL.md +44 -51
  12. package/assets/.agents/skills/codemunch/SKILL.md +42 -520
  13. package/assets/.agents/skills/codemunch/references/ast-driven-protocol.md +543 -0
  14. package/assets/.agents/skills/codesnipe/SKILL.md +41 -648
  15. package/assets/.agents/skills/codesnipe/references/dual-codebase-playbook.md +671 -0
  16. package/assets/.agents/skills/eval-harness/SKILL.md +7 -1
  17. package/assets/.agents/skills/handoff-lint/SKILL.md +6 -0
  18. package/assets/.agents/skills/incident-commander/SKILL.md +6 -0
  19. package/assets/.agents/skills/memory-curator/SKILL.md +7 -1
  20. package/assets/.agents/skills/release-sentry/SKILL.md +6 -0
  21. package/assets/.agents/skills/risk-quant/SKILL.md +7 -1
  22. package/assets/.agents/skills/schema-forge/SKILL.md +7 -1
  23. package/assets/.agents/skills/skill-auditor/SKILL.md +1 -1
  24. package/assets/.agents/skills/state-auditor/SKILL.md +7 -1
  25. package/assets/agent-state/ACE_WORKFLOW.md +65 -0
  26. package/assets/agent-state/INTERFACE_REGISTRY.md +1 -0
  27. package/assets/agent-state/MODULES/schemas/ACE_RUNTIME_PROFILE.schema.json +79 -0
  28. package/assets/scripts/copilot-hook-dispatch.mjs +39 -1
  29. package/assets/tasks/README.md +26 -0
  30. package/dist/ace-autonomy.d.ts +137 -0
  31. package/dist/ace-autonomy.d.ts.map +1 -0
  32. package/dist/ace-autonomy.js +472 -0
  33. package/dist/ace-autonomy.js.map +1 -0
  34. package/dist/agent-runtime/role-adapters.d.ts.map +1 -1
  35. package/dist/agent-runtime/role-adapters.js +47 -6
  36. package/dist/agent-runtime/role-adapters.js.map +1 -1
  37. package/dist/helpers.d.ts.map +1 -1
  38. package/dist/helpers.js +8 -33
  39. package/dist/helpers.js.map +1 -1
  40. package/dist/problem-triage.d.ts.map +1 -1
  41. package/dist/problem-triage.js +19 -0
  42. package/dist/problem-triage.js.map +1 -1
  43. package/dist/prompts.d.ts.map +1 -1
  44. package/dist/prompts.js +101 -0
  45. package/dist/prompts.js.map +1 -1
  46. package/dist/public-surface.d.ts.map +1 -1
  47. package/dist/public-surface.js +6 -0
  48. package/dist/public-surface.js.map +1 -1
  49. package/dist/resources.d.ts.map +1 -1
  50. package/dist/resources.js +29 -0
  51. package/dist/resources.js.map +1 -1
  52. package/dist/runtime-executor.d.ts.map +1 -1
  53. package/dist/runtime-executor.js +158 -0
  54. package/dist/runtime-executor.js.map +1 -1
  55. package/dist/runtime-profile.d.ts +18 -0
  56. package/dist/runtime-profile.d.ts.map +1 -1
  57. package/dist/runtime-profile.js +39 -3
  58. package/dist/runtime-profile.js.map +1 -1
  59. package/dist/shared.d.ts.map +1 -1
  60. package/dist/shared.js +1 -0
  61. package/dist/shared.js.map +1 -1
  62. package/dist/tools-framework.d.ts.map +1 -1
  63. package/dist/tools-framework.js +366 -128
  64. package/dist/tools-framework.js.map +1 -1
  65. package/dist/tools-memory.d.ts.map +1 -1
  66. package/dist/tools-memory.js +80 -0
  67. package/dist/tools-memory.js.map +1 -1
  68. package/dist/workspace-manager.d.ts.map +1 -1
  69. package/dist/workspace-manager.js +13 -2
  70. package/dist/workspace-manager.js.map +1 -1
  71. package/package.json +1 -1
@@ -11,6 +11,12 @@ description:
11
11
  Prevent malformed or context-losing transitions by applying strict handoff validation rules.
12
12
  A handoff without evidence is a broken telephone. This skill is the dial tone check.
13
13
 
14
+ ## Canonical Use Cases
15
+
16
+ 1. An agent is about to write `agent-state/HANDOFF.json` and needs a blocking validation pass first.
17
+ 2. A swarm handoff payload was generated after a complex routing cycle and someone needs to verify schema, evidence refs, and topology before persistence.
18
+ 3. Post-incident forensics found suspicious transitions and the team needs to replay handoff validity checks deterministically.
19
+
14
20
  ---
15
21
 
16
22
  ## MICE Boundaries
@@ -11,6 +11,12 @@ description:
11
11
  Restore control during autonomy incidents while preserving forensic traceability and post-incident learning.
12
12
  An incident without a commander is chaos. An incident with a commander is a learning opportunity.
13
13
 
14
+ ## Canonical Use Cases
15
+
16
+ 1. Two or more consecutive gate failures indicate the normal recovery loop is not containing the issue.
17
+ 2. Multiple blockers or contradictory state files are stalling several agents and someone needs a single accountable incident owner plus timeline.
18
+ 3. Releases must remain paused after an incident until mitigation, blast radius, and closure evidence are explicit.
19
+
14
20
  ---
15
21
 
16
22
  ## MICE Boundaries
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: memory-curator
3
3
  description:
4
- Curate durable autonomy memory by reconciling evidence, decisions, and risks into a concise, contradiction-free index.
4
+ Reconcile evidence, decisions, and risks into durable memory artifacts. Use when agent-state is noisy, contradictory, stale, or needs compression before handoff.
5
5
  ---
6
6
 
7
7
  # Memory Curator
@@ -11,6 +11,12 @@ description:
11
11
  Keep long-running autonomy state compact, accurate, and evidence-linked so agents reason from truth, not stale noise.
12
12
  Memory without curation is hoarding. Memory with curation is institutional knowledge.
13
13
 
14
+ ## Canonical Use Cases
15
+
16
+ 1. `EVIDENCE_LOG.md` and related state files are growing noisy and handoff context needs compression without losing provenance.
17
+ 2. Contradictory decisions, risks, or evidence claims must be reconciled before another routing or release pass.
18
+ 3. A long-running workspace needs a durable memory index so later agents do not repeat old analysis.
19
+
14
20
  ---
15
21
 
16
22
  ## MICE Boundaries
@@ -11,6 +11,12 @@ description:
11
11
  Make release decisions explicit, reversible, and evidence-backed.
12
12
  No artifact moves toward users without a deterministic gate pass.
13
13
 
14
+ ## Canonical Use Cases
15
+
16
+ 1. A verified build is being considered for release-candidate or production promotion.
17
+ 2. The team needs a hold/approve decision with rollback readiness and provenance evidence explicitly documented.
18
+ 3. Releases are resuming after an incident and someone must verify gate completeness before land or production movement.
19
+
14
20
  ---
15
21
 
16
22
  ## MICE Boundaries
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: risk-quant
3
3
  description:
4
- Quantify risk posture with probability-impact scoring, owner assignment, and mitigation quality checks.
4
+ Score and prioritize execution risks with owners, mitigations, and verification conditions. Use when new blockers appear, release risk must be assessed, or handoffs reference unscored risk.
5
5
  ---
6
6
 
7
7
  # Risk Quant
@@ -11,6 +11,12 @@ description:
11
11
  Convert vague risks into measurable, owner-linked mitigation plans that can gate execution.
12
12
  Risk without quantification is anxiety. Risk with quantification is engineering.
13
13
 
14
+ ## Canonical Use Cases
15
+
16
+ 1. A new blocker, architecture change, or dependency cascade appears and needs immediate scoring plus ownership.
17
+ 2. A release or handoff decision references risk, but the risk is still qualitative or incomplete.
18
+ 3. A mitigation plan exists and someone needs to verify whether it actually lowers gate-blocking risk.
19
+
14
20
  ---
15
21
 
16
22
  ## MICE Boundaries
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: schema-forge
3
3
  description:
4
- Contract engineering skill for JSON schemas, compatibility strategy, and migration-safe interface evolution across ACE modules.
4
+ Evolve ACE interface schemas safely with versioning, compatibility analysis, and migration guidance. Use when handoff, status, or artifact contracts change or a schema violation must be repaired.
5
5
  ---
6
6
 
7
7
  # Schema Forge
@@ -11,6 +11,12 @@ description:
11
11
  Guarantee interoperability by evolving schemas with strict validation, versioning, and consumer-safe migration rules.
12
12
  Schema without versioning is a landmine. Schema with versioning is a contract.
13
13
 
14
+ ## Canonical Use Cases
15
+
16
+ 1. A handoff, status event, or artifact schema needs a new field or compatibility-safe evolution.
17
+ 2. A breaking contract change is proposed and the team needs versioning, migration guidance, and producer/consumer mapping.
18
+ 3. A schema violation exposed drift between contract and consumers, and the interface must be repaired safely.
19
+
14
20
  ---
15
21
 
16
22
  ## MICE Boundaries
@@ -35,7 +35,7 @@ Use this skill to inspect the current ACE skill catalog before a remediation pas
35
35
 
36
36
  ## Validation
37
37
 
38
- - Run the `skill_audit` MCP tool and verify that it writes `agent-state/SKILL_AUDIT_REPORT.md`.
38
+ - Run the `skill_audit` MCP tool when it is available, or perform a direct catalog inspection of discoverable `SKILL.md` files, and verify that `agent-state/SKILL_AUDIT_REPORT.md` is written.
39
39
  - Confirm that a skill missing required sections is flagged as `fail`.
40
40
  - Confirm that a skill with optional client overlays but no portability note is flagged as `warn`, not as a hard failure for missing `openai.yaml`.
41
41
 
@@ -11,6 +11,12 @@ description:
11
11
  Detect and repair state drift across `agent-state/` so autonomous execution remains coherent and reproducible.
12
12
  State without audit is faith. State with audit is engineering.
13
13
 
14
+ ## Canonical Use Cases
15
+
16
+ 1. A role transition or handoff is about to occur and the team needs a fast check that core state files agree.
17
+ 2. A blocker persists or contradictory state is suspected, and someone needs a deterministic drift report before acting.
18
+ 3. A release or post-incident checkpoint needs proof that status, evidence, risks, and routing state are coherent.
19
+
14
20
  ---
15
21
 
16
22
  ## MICE Boundaries
@@ -44,7 +50,7 @@ Use when:
44
50
 
45
51
  ---
46
52
 
47
- ## Required Inputs
53
+ ## Inputs
48
54
 
49
55
  - `agent-state/TASK.md`
50
56
  - `agent-state/STATUS.md`
@@ -20,6 +20,22 @@ executor:
20
20
  turn_timeout_ms: 300000
21
21
  tools:
22
22
  registry_path: "agent-state/runtime-tool-specs.json"
23
+ autonomy:
24
+ orchestrator_preflight: true
25
+ recall_context: true
26
+ state_sources: ["agent-state/TASK.md", "agent-state/SCOPE.md", "agent-state/QUALITY_GATES.md", "agent-state/STATUS.md", "agent-state/HANDOFF.json", "agent-state/EVIDENCE_LOG.md"]
27
+ before_run_checks: []
28
+ stop_checks: []
29
+ review_mode: null
30
+ continuity:
31
+ enabled: true
32
+ source_paths: ["agent-state/TASK.md", "agent-state/SCOPE.md", "agent-state/QUALITY_GATES.md", "agent-state/HANDOFF.json", "agent-state/STATUS.md", "agent-state/DECISIONS.md", "agent-state/RISKS.md", "agent-state/EVIDENCE_LOG.md"]
33
+ max_sources: 6
34
+ max_excerpt_chars: 450
35
+ max_total_chars: 2600
36
+ max_status_events: 6
37
+ max_run_ledger_entries: 4
38
+ include_snapshot: true
23
39
  tracker:
24
40
  kind: "none"
25
41
  config: {}
@@ -35,6 +51,11 @@ observability:
35
51
 
36
52
  Operate under ACE runtime profile `{{runtime.profile_name}}` in `{{runtime.mode}}` mode.
37
53
 
54
+ ## Runtime Intent
55
+ - Use this profile for ACE execution that must stay aligned to file-backed state and managed workspace policy.
56
+ - Treat front matter as execution policy. If a field is `null`, `false`, or empty, do not invent extra runtime machinery.
57
+ - Preserve objective, boundary, evidence, and transition truth inside ACE artifacts rather than chat-local memory.
58
+
38
59
  ## Task
39
60
  {{task}}
40
61
 
@@ -52,6 +73,45 @@ Operate under ACE runtime profile `{{runtime.profile_name}}` in `{{runtime.mode}
52
73
  ## Runtime Tools
53
74
  - Registry: `{{tools.registry_path}}`
54
75
 
76
+ ## Autonomy
77
+ - Orchestrator preflight: `{{autonomy.orchestrator_preflight}}`
78
+ - Recall context: `{{autonomy.recall_context}}`
79
+ - State sources: `{{autonomy.state_sources}}`
80
+ - Before-run checks: `{{autonomy.before_run_checks}}`
81
+ - Stop checks: `{{autonomy.stop_checks}}`
82
+ - Review mode: `{{autonomy.review_mode}}`
83
+
84
+ ## Autonomy Guidance
85
+ - `orchestrator_preflight` means validate ACE truth before substantial work or delegation.
86
+ - `recall_context` means prefer current task, status, handoff, and evidence state over stale thread assumptions.
87
+ - `before_run_checks` are blocking checks. If they fail, stop and surface the failure through ACE evidence and status channels.
88
+ - `stop_checks` are terminal or handoff checks. If they fail, do not continue optimistically.
89
+ - `review_mode` must stay inside existing ACE tools and artifacts; it is an overlay, not a second subsystem.
90
+
91
+ ## Continuity
92
+ - Enabled: `{{continuity.enabled}}`
93
+ - Source paths: `{{continuity.source_paths}}`
94
+ - Max sources: `{{continuity.max_sources}}`
95
+ - Max excerpt chars: `{{continuity.max_excerpt_chars}}`
96
+ - Max total chars: `{{continuity.max_total_chars}}`
97
+ - Max status events: `{{continuity.max_status_events}}`
98
+ - Max run-ledger entries: `{{continuity.max_run_ledger_entries}}`
99
+ - Include snapshot: `{{continuity.include_snapshot}}`
100
+
101
+ ## Continuity Guidance
102
+ - Continuity packets are derived from current ACE truth; they are not a replacement source of truth.
103
+ - Treat the configured budgets as source-side compaction rules for unattended execution and delegation, including recent status and run-ledger visibility.
104
+ - If continuity is disabled, do not synthesize a replacement packet in chat or hidden state.
105
+
106
+ ## ACE Recall
107
+ {{ace_state_recall_md}}
108
+
109
+ ## Context Snapshot
110
+ {{ace_context_snapshot_md}}
111
+
112
+ ## Continuity Packet
113
+ {{ace_continuity_packet_md}}
114
+
55
115
  ## Tracker
56
116
  - Kind: `{{tracker.kind}}`
57
117
 
@@ -64,3 +124,8 @@ Operate under ACE runtime profile `{{runtime.profile_name}}` in `{{runtime.mode}
64
124
  - Preserve ACE state artifacts as the durable source of truth.
65
125
  - Treat Vericify as an optional sidecar, not a required ACE runtime dependency.
66
126
  - Treat this template as additive execution guidance for future unattended flows.
127
+
128
+ ## Failure Handling
129
+ - When the task contract, evidence, or hooks are contradictory, prefer hold/escalation over optimistic continuation.
130
+ - Record blockers in ACE artifacts with owners and evidence refs before handing off or stopping.
131
+ - If the profile is missing capabilities, keep the gap explicit rather than silently broadening the runtime contract.
@@ -19,6 +19,7 @@
19
19
  - `ACE_WORKFLOW.md` is the canonical workspace runtime profile artifact.
20
20
  - Its YAML front matter must validate against `MODULES/schemas/ACE_RUNTIME_PROFILE.schema.json`.
21
21
  - The markdown body after the closing front matter boundary is the active runtime prompt template.
22
+ - The optional `continuity` block only budgets derived packet content; it must not redefine canonical ACE truth outside the existing state artifacts and sidecar-native stores.
22
23
 
23
24
  ## Workspace Session Contract
24
25
 
@@ -148,6 +148,85 @@
148
148
  }
149
149
  }
150
150
  },
151
+ "autonomy": {
152
+ "type": "object",
153
+ "additionalProperties": false,
154
+ "properties": {
155
+ "orchestrator_preflight": {
156
+ "type": "boolean"
157
+ },
158
+ "recall_context": {
159
+ "type": "boolean"
160
+ },
161
+ "state_sources": {
162
+ "type": "array",
163
+ "items": {
164
+ "type": "string",
165
+ "minLength": 1
166
+ }
167
+ },
168
+ "before_run_checks": {
169
+ "type": "array",
170
+ "items": {
171
+ "type": "string",
172
+ "minLength": 1
173
+ }
174
+ },
175
+ "stop_checks": {
176
+ "type": "array",
177
+ "items": {
178
+ "type": "string",
179
+ "minLength": 1
180
+ }
181
+ },
182
+ "review_mode": {
183
+ "type": [
184
+ "string",
185
+ "null"
186
+ ],
187
+ "minLength": 1
188
+ }
189
+ }
190
+ },
191
+ "continuity": {
192
+ "type": "object",
193
+ "additionalProperties": false,
194
+ "properties": {
195
+ "enabled": {
196
+ "type": "boolean"
197
+ },
198
+ "source_paths": {
199
+ "type": "array",
200
+ "items": {
201
+ "type": "string",
202
+ "minLength": 1
203
+ }
204
+ },
205
+ "max_sources": {
206
+ "type": "integer",
207
+ "minimum": 1
208
+ },
209
+ "max_excerpt_chars": {
210
+ "type": "integer",
211
+ "minimum": 1
212
+ },
213
+ "max_total_chars": {
214
+ "type": "integer",
215
+ "minimum": 1
216
+ },
217
+ "max_status_events": {
218
+ "type": "integer",
219
+ "minimum": 1
220
+ },
221
+ "max_run_ledger_entries": {
222
+ "type": "integer",
223
+ "minimum": 1
224
+ },
225
+ "include_snapshot": {
226
+ "type": "boolean"
227
+ }
228
+ }
229
+ },
151
230
  "tracker": {
152
231
  "type": "object",
153
232
  "additionalProperties": false,
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { existsSync } from "node:fs";
3
+ import { existsSync, readFileSync } from "node:fs";
4
4
  import { resolve } from "node:path";
5
5
 
6
6
  const DESTRUCTIVE_COMMAND_PATTERNS = [
@@ -82,6 +82,40 @@ function aceContext(workspaceRoot) {
82
82
  };
83
83
  }
84
84
 
85
+ function readAutonomyHint(workspaceRoot) {
86
+ const workflowPath = resolve(workspaceRoot, "agent-state", "ACE_WORKFLOW.md");
87
+ const defaultHint =
88
+ "Runtime autonomy defaults are active: orchestrator preflight, context recall.";
89
+ if (!existsSync(workflowPath)) return defaultHint;
90
+
91
+ let raw = "";
92
+ try {
93
+ raw = readFileSync(workflowPath, "utf8");
94
+ } catch {
95
+ return defaultHint;
96
+ }
97
+
98
+ if (!/^\s*autonomy:\s*$/m.test(raw)) {
99
+ return defaultHint;
100
+ }
101
+
102
+ const signals = [];
103
+ if (/^\s*autonomy:\s*$/m.test(raw) && /^\s*orchestrator_preflight:\s*true\s*$/m.test(raw)) {
104
+ signals.push("orchestrator preflight");
105
+ }
106
+ if (/^\s*autonomy:\s*$/m.test(raw) && /^\s*recall_context:\s*true\s*$/m.test(raw)) {
107
+ signals.push("context recall");
108
+ }
109
+ const reviewMode = raw.match(/^\s*review_mode:\s*["']?([A-Za-z0-9_-]+)["']?\s*$/m)?.[1];
110
+ if (reviewMode) {
111
+ signals.push(`review mode ${reviewMode}`);
112
+ }
113
+
114
+ return signals.length > 0
115
+ ? `Runtime autonomy policy is active in agent-state/ACE_WORKFLOW.md: ${signals.join(", ")}.`
116
+ : "";
117
+ }
118
+
85
119
  function buildAceMessage(workspaceRoot) {
86
120
  const context = aceContext(workspaceRoot);
87
121
  if (!context.hasAgentState && !context.hasSkills) return "";
@@ -103,6 +137,10 @@ function buildAceMessage(workspaceRoot) {
103
137
  if (context.hasSkills) {
104
138
  parts.push("Workspace skills are available under .agents/skills/.");
105
139
  }
140
+ const autonomyHint = readAutonomyHint(workspaceRoot);
141
+ if (autonomyHint) {
142
+ parts.push(autonomyHint);
143
+ }
106
144
  parts.push(
107
145
  "Copilot hook policy protects .github/hooks, .vscode/settings.json, and scripts/ace/copilot-hook-dispatch.mjs from silent self-modification."
108
146
  );
@@ -14,9 +14,35 @@ This directory contains shared execution artifacts consumed by ACE prompts, tool
14
14
  - `agent-state/job-locks.json`: collision-free scheduler locks.
15
15
  - `agent-state/scheduler-lease.json`: active scheduler lease ownership.
16
16
 
17
+ ## When To Read This Directory
18
+
19
+ - Before starting non-trivial work that needs explicit task, role, or handoff structure.
20
+ - Before issuing or consuming a `SWARM_HANDOFF`.
21
+ - When recovering blocked or deferred work through the scheduler and TODO surfaces.
22
+ - When a repeated failure should become a durable lesson or guardrail.
23
+
24
+ ## Common Workflows
25
+
26
+ 1. Start work: check `todo.md`, then use `role_tasks.md` to confirm the bounded contract for the active role.
27
+ 2. Route work: begin from `SWARM_HANDOFF.template.json`, then compare with the example payloads before publishing.
28
+ 3. Recover work: inspect `agent-state/job-queue.json`, `agent-state/job-locks.json`, and `agent-state/scheduler-lease.json` together instead of in isolation.
29
+ 4. Harden work: write repeatable failures to `lessons.md` so the same mistake does not re-enter the loop.
30
+
17
31
  ## Operating Rules
18
32
 
19
33
  1. Update `todo.md` before non-trivial work and after verification.
20
34
  2. Log every repeatable correction pattern in `lessons.md`.
21
35
  3. Use `SWARM_HANDOFF.template.json` as the base for all routing payloads.
22
36
  4. Keep acceptance criteria measurable and tied to file-based evidence.
37
+
38
+ ## Validation Rules
39
+
40
+ - Handoffs must reference real artifacts, owners, and acceptance criteria.
41
+ - Scheduler state is advisory unless it matches current task and status artifacts.
42
+ - Lessons should capture a failure pattern, a guardrail, and a verification check, not just an anecdote.
43
+
44
+ ## Common Failure Modes
45
+
46
+ - `todo.md` is stale while work has already moved; refresh it before trusting downstream routing.
47
+ - A handoff exists without evidence or acceptance criteria; treat it as incomplete, not merely “draft.”
48
+ - Scheduler files disagree with task or status truth; route the contradiction through ops instead of guessing which surface won.
@@ -0,0 +1,137 @@
1
+ export declare const ACE_TASK_CONTRACT_FILES: readonly ["agent-state/TASK.md", "agent-state/SCOPE.md", "agent-state/QUALITY_GATES.md", "agent-state/HANDOFF.json"];
2
+ export declare const ACE_DEFAULT_STATE_SOURCES: readonly ["agent-state/TASK.md", "agent-state/SCOPE.md", "agent-state/QUALITY_GATES.md", "agent-state/STATUS.md", "agent-state/HANDOFF.json", "agent-state/EVIDENCE_LOG.md"];
3
+ export declare const ACE_DEFAULT_CONTINUITY_SOURCES: readonly ["agent-state/TASK.md", "agent-state/SCOPE.md", "agent-state/QUALITY_GATES.md", "agent-state/HANDOFF.json", "agent-state/STATUS.md", "agent-state/DECISIONS.md", "agent-state/RISKS.md", "agent-state/EVIDENCE_LOG.md"];
4
+ export interface AutonomyPolicyConfig {
5
+ orchestrator_preflight?: boolean | null;
6
+ recall_context?: boolean | null;
7
+ state_sources?: string[] | null;
8
+ before_run_checks?: string[] | null;
9
+ stop_checks?: string[] | null;
10
+ review_mode?: string | null;
11
+ }
12
+ export interface NormalizedAutonomyPolicy {
13
+ orchestrator_preflight: boolean;
14
+ recall_context: boolean;
15
+ state_sources: string[];
16
+ before_run_checks: string[];
17
+ stop_checks: string[];
18
+ review_mode: string | null;
19
+ }
20
+ export interface ContinuityPolicyConfig {
21
+ enabled?: boolean | null;
22
+ source_paths?: string[] | null;
23
+ max_sources?: number | null;
24
+ max_excerpt_chars?: number | null;
25
+ max_total_chars?: number | null;
26
+ max_status_events?: number | null;
27
+ max_run_ledger_entries?: number | null;
28
+ include_snapshot?: boolean | null;
29
+ }
30
+ export interface NormalizedContinuityPolicy {
31
+ enabled: boolean;
32
+ source_paths: string[];
33
+ max_sources: number;
34
+ max_excerpt_chars: number;
35
+ max_total_chars: number;
36
+ max_status_events: number;
37
+ max_run_ledger_entries: number;
38
+ include_snapshot: boolean;
39
+ }
40
+ export interface AceFileStatus {
41
+ path: string;
42
+ present: boolean;
43
+ valid: boolean;
44
+ note: string;
45
+ }
46
+ export interface AceTaskContractAssessment {
47
+ ok: boolean;
48
+ summary: string;
49
+ missing: string[];
50
+ invalid: string[];
51
+ blockers: string[];
52
+ files: AceFileStatus[];
53
+ handoff_status?: string;
54
+ handoff_reason?: string;
55
+ }
56
+ export interface AceStateSlice {
57
+ path: string;
58
+ present: boolean;
59
+ excerpt: string;
60
+ }
61
+ export interface AceContextSnapshot {
62
+ name: string;
63
+ timestamp: string;
64
+ summary: string;
65
+ path: string;
66
+ content: string;
67
+ }
68
+ export interface AceRecallContext {
69
+ task_contract: AceTaskContractAssessment;
70
+ state_slices: AceStateSlice[];
71
+ snapshot?: AceContextSnapshot;
72
+ }
73
+ export interface AceContinuityPacketSource {
74
+ path: string;
75
+ excerpt: string;
76
+ chars: number;
77
+ }
78
+ export interface AceContinuityPacketEvent {
79
+ timestamp: string;
80
+ source_module: string;
81
+ event_type: string;
82
+ status: string;
83
+ summary: string;
84
+ }
85
+ export interface AceContinuityPacketRunEntry {
86
+ timestamp: string;
87
+ tool: string;
88
+ category: string;
89
+ message: string;
90
+ artifacts: string[];
91
+ }
92
+ export interface AceContinuityPacket {
93
+ generated_at: string;
94
+ summary: string;
95
+ highlights: string[];
96
+ task_contract_ok: boolean;
97
+ blockers: string[];
98
+ included_sources: AceContinuityPacketSource[];
99
+ missing_sources: string[];
100
+ dropped_sources: string[];
101
+ recent_status_events: AceContinuityPacketEvent[];
102
+ recent_run_ledger: AceContinuityPacketRunEntry[];
103
+ snapshot?: {
104
+ name: string;
105
+ timestamp: string;
106
+ summary: string;
107
+ path: string;
108
+ };
109
+ budget_report: {
110
+ max_sources: number;
111
+ max_excerpt_chars: number;
112
+ max_total_chars: number;
113
+ max_status_events: number;
114
+ max_run_ledger_entries: number;
115
+ used_chars: number;
116
+ };
117
+ }
118
+ export declare const DEFAULT_AUTONOMY_POLICY: NormalizedAutonomyPolicy;
119
+ export declare const DEFAULT_CONTINUITY_POLICY: NormalizedContinuityPolicy;
120
+ export declare function normalizeAutonomyPolicy(input?: AutonomyPolicyConfig | null): NormalizedAutonomyPolicy;
121
+ export declare function normalizeContinuityPolicy(input?: ContinuityPolicyConfig | null): NormalizedContinuityPolicy;
122
+ export declare function readAceTaskContractAssessment(): AceTaskContractAssessment;
123
+ export declare function readAceContextSnapshot(name?: string): AceContextSnapshot | undefined;
124
+ export declare function buildAceRecallContext(input?: {
125
+ state_sources?: readonly string[];
126
+ snapshot_name?: string;
127
+ excerpt_chars?: number;
128
+ }): AceRecallContext;
129
+ export declare function buildAceContinuityPacket(input?: {
130
+ state_sources?: readonly string[];
131
+ snapshot_name?: string;
132
+ policy?: ContinuityPolicyConfig | NormalizedContinuityPolicy | null;
133
+ }): AceContinuityPacket;
134
+ export declare function formatAceRecallMarkdown(recall: AceRecallContext): string;
135
+ export declare function formatAceContinuityPacketMarkdown(packet: AceContinuityPacket): string;
136
+ export declare function buildAutonomyHookEnv(policy: NormalizedAutonomyPolicy, continuity?: NormalizedContinuityPolicy): Record<string, string>;
137
+ //# sourceMappingURL=ace-autonomy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ace-autonomy.d.ts","sourceRoot":"","sources":["../src/ace-autonomy.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,uBAAuB,sHAK1B,CAAC;AAEX,eAAO,MAAM,yBAAyB,8KAO5B,CAAC;AAEX,eAAO,MAAM,8BAA8B,kOASjC,CAAC;AAEX,MAAM,WAAW,oBAAoB;IACnC,sBAAsB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACxC,cAAc,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAwB;IACvC,sBAAsB,EAAE,OAAO,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;IACx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