intentdna 1.7.4 → 1.8.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/LICENSE +201 -0
- package/README.md +143 -194
- package/dist/assets/candidates.d.ts +124 -0
- package/dist/assets/candidates.js +1249 -0
- package/dist/assets/catalog.d.ts +101 -0
- package/dist/assets/catalog.js +311 -0
- package/dist/assets/evidence.d.ts +93 -0
- package/dist/assets/evidence.js +391 -0
- package/dist/assets/index.d.ts +4 -0
- package/dist/assets/index.js +4 -0
- package/dist/assets/metadata.d.ts +19 -0
- package/dist/assets/metadata.js +227 -0
- package/dist/cli/commands/assets.d.ts +65 -0
- package/dist/cli/commands/assets.js +2871 -0
- package/dist/cli/commands/auth.d.ts +322 -0
- package/dist/cli/commands/auth.js +1592 -0
- package/dist/cli/commands/cloud-auth-guidance.d.ts +2 -0
- package/dist/cli/commands/cloud-auth-guidance.js +4 -0
- package/dist/cli/commands/cloud.d.ts +1359 -0
- package/dist/cli/commands/cloud.js +8364 -0
- package/dist/cli/commands/evolve.js +18 -2
- package/dist/cli/commands/generate.js +25 -2
- package/dist/cli/commands/guard.d.ts +1 -1
- package/dist/cli/commands/guard.js +1 -1
- package/dist/cli/commands/guide.d.ts +15 -0
- package/dist/cli/commands/guide.js +1747 -0
- package/dist/cli/commands/init.d.ts +12 -0
- package/dist/cli/commands/init.js +95 -60
- package/dist/cli/commands/org.d.ts +16 -0
- package/dist/cli/commands/org.js +2393 -0
- package/dist/cli/commands/release.d.ts +59 -0
- package/dist/cli/commands/release.js +716 -0
- package/dist/cli/commands/report.d.ts +82 -0
- package/dist/cli/commands/report.js +1516 -0
- package/dist/cli/commands/run.d.ts +6 -1
- package/dist/cli/commands/run.js +95 -26
- package/dist/cli/commands/sync.d.ts +8 -1
- package/dist/cli/commands/sync.js +436 -141
- package/dist/cli/commands/templates.d.ts +64 -0
- package/dist/cli/commands/templates.js +2151 -1
- package/dist/cli/commands/workflow.d.ts +26 -0
- package/dist/cli/commands/workflow.js +3053 -0
- package/dist/cli/index.js +719 -42
- package/dist/compiler/cascade.js +4 -9
- package/dist/compiler/compile.js +1 -0
- package/dist/governance/evidence-capture-attribution.d.ts +12 -0
- package/dist/governance/evidence-capture-attribution.js +46 -0
- package/dist/governance/index.d.ts +2 -0
- package/dist/governance/index.js +1 -0
- package/dist/hooks/cli.d.ts +6 -0
- package/dist/hooks/cli.js +168 -12
- package/dist/hooks/enforce.d.ts +1 -0
- package/dist/hooks/protocol.d.ts +1 -1
- package/dist/hooks/protocol.js +1 -1
- package/dist/hooks/state.d.ts +41 -0
- package/dist/hooks/state.js +126 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/mcp/tools-state.js +2 -0
- package/dist/organization/index.d.ts +121 -0
- package/dist/organization/index.js +413 -0
- package/dist/runtime/claude-sync-target.d.ts +49 -0
- package/dist/runtime/claude-sync-target.js +280 -0
- package/dist/runtime/codex-adapter.d.ts +254 -0
- package/dist/runtime/codex-adapter.js +1204 -0
- package/dist/runtime/codex-sync-target.d.ts +33 -0
- package/dist/runtime/codex-sync-target.js +241 -0
- package/dist/runtime/index.d.ts +8 -0
- package/dist/runtime/index.js +4 -0
- package/dist/runtime/output-artifact-registry.d.ts +1 -1
- package/dist/runtime/output-artifact-registry.js +2 -0
- package/dist/runtime/settings-adapter.d.ts +1 -1
- package/dist/runtime/settings-adapter.js +1 -1
- package/dist/runtime/skill-adapter.d.ts +5 -1
- package/dist/runtime/skill-adapter.js +120 -34
- package/dist/runtime/sync-artifact-registry.d.ts +99 -0
- package/dist/runtime/sync-artifact-registry.js +194 -0
- package/dist/runtime/sync-target-plan.d.ts +45 -0
- package/dist/runtime/sync-target-plan.js +19 -0
- package/dist/schema/controller-registry.d.ts +8 -1
- package/dist/schema/controller-registry.js +8 -0
- package/dist/schema/types.d.ts +35 -23
- package/dist/schema/types.js +10 -1
- package/dist/schema/validate.js +22 -22
- package/dist/schema/validators/controllers.js +38 -20
- package/dist/schema/workflow-authoring-contract.d.ts +29 -0
- package/dist/schema/workflow-authoring-contract.js +109 -0
- package/dist/schema/yaml-parser.js +18 -0
- package/dist/templates/api-backend.dna.yaml +19 -0
- package/dist/templates/brainstorming-first.dna.yaml +19 -0
- package/dist/templates/code-cleanup.dna.yaml +19 -0
- package/dist/templates/code-review-pipeline.dna.yaml +18 -0
- package/dist/templates/documentation-writer.dna.yaml +19 -0
- package/dist/templates/flutter-behavior-lock.dna.yaml +19 -0
- package/dist/templates/flutter-refactoring-rescue.dna.yaml +19 -0
- package/dist/templates/flutter-rewrite-diagnosis-review.dna.yaml +210 -0
- package/dist/templates/flutter-rewrite-fix-review-loop.dna.yaml +260 -0
- package/dist/templates/flutter-rewrite-new.dna.yaml +506 -0
- package/dist/templates/flutter-rewrite.dna.yaml +20 -0
- package/dist/templates/frontend-quality.dna.yaml +19 -0
- package/dist/templates/full-pipeline.dna.yaml +20 -0
- package/dist/templates/marketplace.d.ts +92 -0
- package/dist/templates/marketplace.js +502 -0
- package/dist/templates/metadata.d.ts +25 -0
- package/dist/templates/metadata.js +136 -3
- package/dist/templates/mobile-dev.dna.yaml +19 -0
- package/dist/templates/multi-agent-handoff-coordination.dna.yaml +156 -0
- package/dist/templates/multi-perspective-review.dna.yaml +19 -0
- package/dist/templates/persistent-executor.dna.yaml +19 -0
- package/dist/templates/qa-loop.dna.yaml +18 -0
- package/dist/templates/release-evidence-gate.dna.yaml +131 -0
- package/dist/templates/requirements-gate.dna.yaml +19 -0
- package/dist/templates/research-orchestration.dna.yaml +19 -0
- package/dist/templates/root-cause-analysis.dna.yaml +19 -0
- package/dist/templates/safe-refactoring.dna.yaml +321 -0
- package/dist/templates/secure-dev.dna.yaml +19 -0
- package/dist/templates/subagent-parallel.dna.yaml +19 -0
- package/dist/templates/systematic-debugging.dna.yaml +19 -0
- package/dist/templates/tdd-strict.dna.yaml +19 -0
- package/dist/templates/ui-visual-regression-qa.dna.yaml +133 -0
- package/dist/templates/workflow-author.dna.yaml +302 -0
- package/dist/templates/workflow-blocked-scope-triage.dna.yaml +242 -0
- package/dist/templates/workflow-completion-audit.dna.yaml +254 -0
- package/dist/templates/workflow-cross-boundary-resource-approval.dna.yaml +249 -0
- package/dist/templates/workflow-evidence-review.dna.yaml +198 -0
- package/dist/templates/workflow-module-inventory.dna.yaml +257 -0
- package/dist/templates/workflow-runtime-smoke-review.dna.yaml +252 -0
- package/dist/templates/workflow-verification-command-routing.dna.yaml +278 -0
- package/dist/workflow/authoring-packet.d.ts +67 -0
- package/dist/workflow/authoring-packet.js +218 -0
- package/dist/workflow/draft.d.ts +159 -0
- package/dist/workflow/draft.js +800 -0
- package/dist/workflow/index.d.ts +3 -0
- package/dist/workflow/index.js +3 -0
- package/dist/workflow/suggestion-review.d.ts +65 -0
- package/dist/workflow/suggestion-review.js +245 -0
- package/package.json +1 -1
- package/spec/README.md +15 -48
- package/spec/codex-adapter-contract.md +176 -0
- package/spec/sync-target-plan.md +158 -0
- package/spec/workflow-capability-ir.md +153 -0
- package/spec/agent-dispatch-fix.md +0 -116
- package/spec/control-plane-convergence-handoff-2026-04-24.md +0 -432
- package/spec/flutter-rewrite-template-optimization.md +0 -301
- package/spec/foundation-hardening.md +0 -178
- package/spec/hooks-infra-harness-hardening.md +0 -741
- package/spec/multi-config.md +0 -172
- package/spec/parallel-isolation.md +0 -268
- package/spec/template-version-namespace-fix.md +0 -653
- package/spec/workflow-pipeline.md +0 -101
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Sync Target Plan
|
|
2
|
+
|
|
3
|
+
Status: active draft
|
|
4
|
+
Last updated: 2026-06-04
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
This spec defines the boundary that should keep `dna sync` from accumulating every harness-specific rule.
|
|
9
|
+
|
|
10
|
+
`sync` should orchestrate the operation. Target planners and adapters should decide what concrete artifacts a harness needs.
|
|
11
|
+
|
|
12
|
+
## Problem
|
|
13
|
+
|
|
14
|
+
The current CLI has grown from one proven surface:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
DNA -> Claude Code markdown / agents / skills / settings / hooks
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Codex support now adds real artifacts through `dna sync --codex`:
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
DNA -> AGENTS.intentdna.md
|
|
24
|
+
-> Codex plugin hooks
|
|
25
|
+
-> .codex/hooks.json
|
|
26
|
+
-> .codex/config.toml trust state
|
|
27
|
+
-> codex-policy-map.json
|
|
28
|
+
-> codex-adapter-evidence.json
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This is the right product milestone, but it proves the need for a target-planning boundary. Without that boundary, each new capability can add another `runSync` branch.
|
|
32
|
+
|
|
33
|
+
## Desired flow
|
|
34
|
+
|
|
35
|
+
```text
|
|
36
|
+
load / validate DNA
|
|
37
|
+
-> compile ConstraintIR and WorkflowIR
|
|
38
|
+
-> select sync target planners
|
|
39
|
+
-> produce SyncTargetPlan[]
|
|
40
|
+
-> write planned artifacts
|
|
41
|
+
-> record lock / summary / evidence
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Draft target plan shape
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
type SyncTarget = "claude_code" | "codex_cli";
|
|
48
|
+
|
|
49
|
+
interface SyncTargetPlan {
|
|
50
|
+
target: SyncTarget;
|
|
51
|
+
mode: "write" | "remove" | "dry_run";
|
|
52
|
+
artifacts: PlannedArtifact[];
|
|
53
|
+
capability_report: AdapterCapabilityReport;
|
|
54
|
+
evidence_plan: EvidencePlan;
|
|
55
|
+
warnings: string[];
|
|
56
|
+
unsupported: string[];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface PlannedArtifact {
|
|
60
|
+
kind: string;
|
|
61
|
+
path: string;
|
|
62
|
+
ownership: "intentdna_owned" | "owned_block" | "merge_preserve_user" | "diagnostic";
|
|
63
|
+
tracked_by_lock: boolean;
|
|
64
|
+
write?: () => Promise<void>;
|
|
65
|
+
remove?: () => Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface EvidencePlan {
|
|
69
|
+
primary: "RuntimeDecisionEvent" | "none";
|
|
70
|
+
diagnostic_artifacts: string[];
|
|
71
|
+
classification: "enterprise_evidence" | "diagnostic_only" | "unsupported";
|
|
72
|
+
notes: string[];
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
These interfaces are planning contracts, not committed implementation APIs yet.
|
|
77
|
+
|
|
78
|
+
## Target responsibilities
|
|
79
|
+
|
|
80
|
+
### CLI responsibilities
|
|
81
|
+
|
|
82
|
+
- Resolve input files.
|
|
83
|
+
- Validate DNA.
|
|
84
|
+
- Run compile pipeline.
|
|
85
|
+
- Select target planners from CLI flags.
|
|
86
|
+
- Execute target plans.
|
|
87
|
+
- Track generated outputs and lock entries.
|
|
88
|
+
- Print warnings and unsupported gaps.
|
|
89
|
+
|
|
90
|
+
The CLI should not need to understand whether a capability is implemented through a hook, settings file, plugin manifest, policy map, or generated instruction.
|
|
91
|
+
|
|
92
|
+
### Target planner responsibilities
|
|
93
|
+
|
|
94
|
+
- Decide which artifacts are needed.
|
|
95
|
+
- Preserve user-authored files and hooks.
|
|
96
|
+
- Encode install-mode semantics.
|
|
97
|
+
- Produce capability support reports.
|
|
98
|
+
- Produce evidence plans.
|
|
99
|
+
- Keep unsupported gaps explicit.
|
|
100
|
+
|
|
101
|
+
### Adapter responsibilities
|
|
102
|
+
|
|
103
|
+
- Map IR channels to concrete harness surfaces.
|
|
104
|
+
- Generate harness-specific artifacts.
|
|
105
|
+
- Verify ownership/trust assumptions where possible.
|
|
106
|
+
- Emit RuntimeDecisionEvent-compatible evidence through the existing state writer.
|
|
107
|
+
|
|
108
|
+
## Current target inventory
|
|
109
|
+
|
|
110
|
+
| Target | Current artifacts |
|
|
111
|
+
|---|---|
|
|
112
|
+
| Claude Code | `CLAUDE.md`, `.claude/agents`, `.claude/skills`, `.claude/settings.json`, `.claude/.mcp.json`, `.dna/compiled/ir.json` |
|
|
113
|
+
| Codex CLI | `AGENTS.intentdna.md`, `codex-plugin/.codex-plugin/plugin.json`, `codex-plugin/hooks/hooks.json`, `.codex/hooks.json`, `.codex/config.toml`, `.dna/compiled/codex-policy-map.json`, `.dna/compiled/codex-adapter-evidence.json` |
|
|
114
|
+
|
|
115
|
+
## Extraction sequence
|
|
116
|
+
|
|
117
|
+
### Step 1: Codex target plan wrapper
|
|
118
|
+
|
|
119
|
+
Codex already has a cohesive adapter function: `compileCodexAdapterArtifacts()`.
|
|
120
|
+
|
|
121
|
+
The first extraction should wrap that function into a Codex target planner without changing artifact contents.
|
|
122
|
+
|
|
123
|
+
Acceptance:
|
|
124
|
+
|
|
125
|
+
- `dna sync --codex` output remains byte-for-byte equivalent except timestamps.
|
|
126
|
+
- Tests for generation, dry-run, remove, preservation, and lock tracking still pass.
|
|
127
|
+
|
|
128
|
+
### Step 2: Claude Code target plan wrapper
|
|
129
|
+
|
|
130
|
+
Move existing Claude Code artifact planning behind a planner boundary.
|
|
131
|
+
|
|
132
|
+
Acceptance:
|
|
133
|
+
|
|
134
|
+
- Existing Claude Code sync behavior remains backward-compatible.
|
|
135
|
+
- The CLI no longer needs to know the semantic reason for each artifact.
|
|
136
|
+
|
|
137
|
+
### Step 3: Shared plan execution
|
|
138
|
+
|
|
139
|
+
Move artifact execution into a shared executor:
|
|
140
|
+
|
|
141
|
+
```text
|
|
142
|
+
for each target plan:
|
|
143
|
+
print warnings
|
|
144
|
+
write/remove artifacts
|
|
145
|
+
track lockable outputs
|
|
146
|
+
summarize unsupported gaps
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Acceptance:
|
|
150
|
+
|
|
151
|
+
- Adding a new capability modifies schema/compiler/adapter/reporting, not `runSync` semantic branches.
|
|
152
|
+
|
|
153
|
+
## Non-goals
|
|
154
|
+
|
|
155
|
+
- Do not add new adapter targets.
|
|
156
|
+
- Do not turn target plans into a runtime.
|
|
157
|
+
- Do not move policy truth into target plans.
|
|
158
|
+
- Do not hide diagnostic-only evidence behind successful artifact writes.
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Workflow Capability IR
|
|
2
|
+
|
|
3
|
+
Status: active draft
|
|
4
|
+
Last updated: 2026-06-04
|
|
5
|
+
|
|
6
|
+
## Purpose
|
|
7
|
+
|
|
8
|
+
This spec defines a capability vocabulary for AI-native workflow infrastructure.
|
|
9
|
+
|
|
10
|
+
It does not require an immediate schema migration. The first use is interpretive: map existing workflow, role, IR, and adapter fields to capability requirements so the system can reason about what a workflow needs and what a harness can actually support.
|
|
11
|
+
|
|
12
|
+
## Design rule
|
|
13
|
+
|
|
14
|
+
Templates declare **what deterministic capability a workflow needs**.
|
|
15
|
+
|
|
16
|
+
Adapters declare **how much of that capability a harness can support**.
|
|
17
|
+
|
|
18
|
+
The CLI should not encode the business semantics of each capability.
|
|
19
|
+
|
|
20
|
+
## Capability lifecycle
|
|
21
|
+
|
|
22
|
+
```text
|
|
23
|
+
workflow template field
|
|
24
|
+
-> WorkflowCapabilityRequirement
|
|
25
|
+
-> ConstraintIR / WorkflowIR / verifier specs
|
|
26
|
+
-> AdapterCapabilityReport
|
|
27
|
+
-> SyncTargetPlan
|
|
28
|
+
-> generated artifacts and RuntimeDecisionEvent evidence
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Capability support status
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
type CapabilitySupportStatus =
|
|
35
|
+
| "supported"
|
|
36
|
+
| "partial"
|
|
37
|
+
| "unknown"
|
|
38
|
+
| "unsupported";
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Support is adapter-specific. A capability can be required by a workflow even when a specific harness only supports it partially.
|
|
42
|
+
|
|
43
|
+
## Draft requirement shape
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
interface WorkflowCapabilityRequirement {
|
|
47
|
+
id: string;
|
|
48
|
+
capability: WorkflowCapability;
|
|
49
|
+
workflow_name: string;
|
|
50
|
+
step_id?: string;
|
|
51
|
+
role?: string;
|
|
52
|
+
source: "workflow" | "role" | "gene" | "verifier" | "adapter";
|
|
53
|
+
severity: "required" | "recommended" | "diagnostic";
|
|
54
|
+
evidence_required: boolean;
|
|
55
|
+
notes: string[];
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
This shape is a planning contract, not a committed TypeScript API yet.
|
|
60
|
+
|
|
61
|
+
## Initial capability vocabulary
|
|
62
|
+
|
|
63
|
+
| Capability | Meaning |
|
|
64
|
+
|---|---|
|
|
65
|
+
| `intent_lock` | The workflow must preserve a clearly scoped user or organization intent across model turns. |
|
|
66
|
+
| `boundary_constraint` | The workflow must constrain read/write/action scope. |
|
|
67
|
+
| `context_control` | The workflow must control what context is required, optional, forbidden, or planning-only. |
|
|
68
|
+
| `tool_policy` | The workflow must allow, deny, warn, or route tool usage by role/step. |
|
|
69
|
+
| `approval_gate` | The workflow must require human or policy approval before a risky action. |
|
|
70
|
+
| `checkpoint` | A step boundary condition must be evaluated after work. |
|
|
71
|
+
| `completion_check` | A step must prove required artifacts or checks before handoff. |
|
|
72
|
+
| `artifact_handoff` | Produced and consumed artifacts must be represented as resolver-backed facts. |
|
|
73
|
+
| `isolation` | Parallel or risky work must run under a declared isolation mode. |
|
|
74
|
+
| `dry_run` | The workflow or adapter must preview writes/actions before committing them. |
|
|
75
|
+
| `rollback_or_compensation` | The workflow must reverse, compensate, or explicitly report irreversible side effects. |
|
|
76
|
+
| `trace` | The workflow needs structured execution trace or lifecycle evidence. |
|
|
77
|
+
| `runtime_decision_evidence` | Decisions must be recorded as RuntimeDecisionEvent-compatible evidence. |
|
|
78
|
+
| `logic_equivalence_validation` | A transformation must prove behavioral or logical equivalence, especially in refactors. |
|
|
79
|
+
|
|
80
|
+
## Existing field mapping
|
|
81
|
+
|
|
82
|
+
| Existing field / IR | Capability |
|
|
83
|
+
|---|---|
|
|
84
|
+
| `WorkflowStepDef.prompt` | `intent_lock` |
|
|
85
|
+
| workflow `description` | `intent_lock` |
|
|
86
|
+
| role `scope` | `boundary_constraint` |
|
|
87
|
+
| role `tool_permissions` | `tool_policy` |
|
|
88
|
+
| `WorkflowStepDef.enforce.read_only` | `boundary_constraint`, `tool_policy` |
|
|
89
|
+
| `WorkflowStepDef.enforce.additional_write_paths` | `boundary_constraint` |
|
|
90
|
+
| `WorkflowStepDef.checkpoints` | `checkpoint` |
|
|
91
|
+
| `WorkflowStepDef.completion` | `completion_check` |
|
|
92
|
+
| `WorkflowStepDef.handoff` | `artifact_handoff` |
|
|
93
|
+
| `WorkflowDef.produces` / `WorkflowDef.consumes` | `artifact_handoff` |
|
|
94
|
+
| `WorkflowStepDef.isolation` | `isolation` |
|
|
95
|
+
| `WorkflowDef.default_isolation` | `isolation` |
|
|
96
|
+
| `context_injections` | `context_control` |
|
|
97
|
+
| `context_sources` / `planning_context` | `context_control` |
|
|
98
|
+
| `verifier_specs` | `checkpoint`, `completion_check`, `runtime_decision_evidence` |
|
|
99
|
+
| `RuntimeDecisionEvent` | `runtime_decision_evidence`, `trace` |
|
|
100
|
+
| Codex adapter `unsupported` list | adapter capability gap evidence |
|
|
101
|
+
|
|
102
|
+
## Refactor equivalence workflow mapping
|
|
103
|
+
|
|
104
|
+
The current dogfood target is a refactor workflow:
|
|
105
|
+
|
|
106
|
+
```text
|
|
107
|
+
intent lock
|
|
108
|
+
-> boundary freeze
|
|
109
|
+
-> baseline characterization
|
|
110
|
+
-> rewrite
|
|
111
|
+
-> equivalence verification
|
|
112
|
+
-> review
|
|
113
|
+
-> evidence package
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Required capabilities:
|
|
117
|
+
|
|
118
|
+
| Step | Required capabilities |
|
|
119
|
+
|---|---|
|
|
120
|
+
| intent lock | `intent_lock`, `context_control` |
|
|
121
|
+
| boundary freeze | `boundary_constraint`, `tool_policy` |
|
|
122
|
+
| baseline characterization | `checkpoint`, `completion_check`, `artifact_handoff` |
|
|
123
|
+
| rewrite | `tool_policy`, `isolation`, `trace` |
|
|
124
|
+
| equivalence verification | `logic_equivalence_validation`, `checkpoint`, `runtime_decision_evidence` |
|
|
125
|
+
| review | `approval_gate`, `completion_check` |
|
|
126
|
+
| evidence package | `artifact_handoff`, `runtime_decision_evidence`, `trace` |
|
|
127
|
+
|
|
128
|
+
## Adapter reporting requirement
|
|
129
|
+
|
|
130
|
+
Every adapter should report capability support without hiding gaps:
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
interface AdapterCapabilityReport {
|
|
134
|
+
adapter: string;
|
|
135
|
+
runtime?: string;
|
|
136
|
+
capabilities: Record<string, {
|
|
137
|
+
status: CapabilitySupportStatus;
|
|
138
|
+
surfaces: string[];
|
|
139
|
+
evidence_refs: string[];
|
|
140
|
+
notes: string[];
|
|
141
|
+
}>;
|
|
142
|
+
unsupported: string[];
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Codex is the active implementation reference. Claude Code remains the proven legacy surface. No additional adapters are implied by this spec.
|
|
147
|
+
|
|
148
|
+
## Non-goals
|
|
149
|
+
|
|
150
|
+
- This spec does not add a new runtime.
|
|
151
|
+
- This spec does not replace ConstraintIR.
|
|
152
|
+
- This spec does not make dashboard/report/state a policy source.
|
|
153
|
+
- This spec does not claim support for a capability unless an adapter maps it to a concrete surface and evidence path.
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
# Spec: F5 Agent 调度漏洞修复
|
|
2
|
-
|
|
3
|
-
## 问题(架构级)
|
|
4
|
-
|
|
5
|
-
DNA 的 skill-adapter.ts 生成的 SKILL.md 用文字提示调度 agent:
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
1. **scan** → @dna-frw-scanner
|
|
9
|
-
Prompt: ...
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
LLM 把这当成建议,选择自己做而非 spawn agent。导致:
|
|
13
|
-
|
|
14
|
-
- agent_type 为空 → role scope 不生效
|
|
15
|
-
- tool_permissions deny 不生效(scanner 能写文件)
|
|
16
|
-
- review/verify 步骤在主 session 做 → 自己审自己
|
|
17
|
-
- handoff chain 无意义(没有跨 agent artifact 传递)
|
|
18
|
-
- agent MD 文件从未被加载
|
|
19
|
-
- 所有 role-based 治理形同虚设
|
|
20
|
-
|
|
21
|
-
## 影响范围
|
|
22
|
-
|
|
23
|
-
**以下交付物全部不生效:**
|
|
24
|
-
|
|
25
|
-
| 功能 | 依赖 | 当前状态 |
|
|
26
|
-
|------|------|---------|
|
|
27
|
-
| Role scope (read/write 范围) | agent_type 匹配 | 不生效 |
|
|
28
|
-
| tool_permissions deny | agent_type 匹配 | 不生效 |
|
|
29
|
-
| review 步骤只读约束 | investigator agent spawn | 不生效 |
|
|
30
|
-
| verify 步骤独立验证 | 独立 agent context | 不生效 |
|
|
31
|
-
| merge-time scope gate | worktree + agent 隔离 | 不生效 |
|
|
32
|
-
| handoff consumes/produces | 跨 agent artifact | 不生效 |
|
|
33
|
-
| step enforce rules (G4) | workflow state + agent_type | 不生效 |
|
|
34
|
-
| agent MD 文件加载 | agent spawn 时 CC 自动加载 | 从未加载 |
|
|
35
|
-
|
|
36
|
-
## 根因
|
|
37
|
-
|
|
38
|
-
OMC 用 Claude Code 原生 `Task(subagent_type=...)` API 强制 spawn agent:
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
Task(subagent_type="oh-my-claudecode:executor", prompt="implement caching")
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
这是 API 级调用,LLM 无法绕过。spawn 的 agent 有独立 context、独立 agent_type,hooks 能识别和 enforce。
|
|
45
|
-
|
|
46
|
-
DNA 的 SKILL.md 只是文字提示,不是 API 调用。
|
|
47
|
-
|
|
48
|
-
## 修复方案
|
|
49
|
-
|
|
50
|
-
### skill-adapter.ts 改动
|
|
51
|
-
|
|
52
|
-
生成的 SKILL.md `<Steps>` 部分从:
|
|
53
|
-
|
|
54
|
-
```markdown
|
|
55
|
-
1. **scan** → @dna-frw-scanner
|
|
56
|
-
Prompt: Scan module...
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
改为:
|
|
60
|
-
|
|
61
|
-
```markdown
|
|
62
|
-
1. **scan**
|
|
63
|
-
Execute with Agent tool — DO NOT perform this work in the main session:
|
|
64
|
-
```
|
|
65
|
-
Agent(subagent_type="dna-frw-scanner", prompt="Scan module '$ARGUMENTS' in common/lib/. ...")
|
|
66
|
-
```
|
|
67
|
-
Wait for agent to complete. Read the agent's output before proceeding.
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
### 关键设计要点
|
|
71
|
-
|
|
72
|
-
1. **每步必须是 Agent() 调用**,不是文字描述
|
|
73
|
-
2. **明确禁止主 session 做 agent 的工作**:"DO NOT perform this work in the main session"
|
|
74
|
-
3. **Agent 输出要读取**:Agent 完成后读取其 output,作为下一步的 handoff
|
|
75
|
-
4. **Agent 工具参数完整**:subagent_type 用 DNA 编译的 agent 名称,prompt 用编译的步骤 prompt
|
|
76
|
-
5. **参考 OMC 的 preamble 模式**:spawn 的 agent 不应再 spawn 子 agent("Do NOT spawn sub-agents")
|
|
77
|
-
|
|
78
|
-
### 生成模板
|
|
79
|
-
|
|
80
|
-
```typescript
|
|
81
|
-
// skill-adapter.ts — 每个 workflow step 生成:
|
|
82
|
-
function generateStepExecution(step, roleName, prompt) {
|
|
83
|
-
return `
|
|
84
|
-
### Step: ${step.id}
|
|
85
|
-
|
|
86
|
-
Execute with Agent tool — DO NOT perform this work yourself:
|
|
87
|
-
|
|
88
|
-
\`\`\`
|
|
89
|
-
Agent(
|
|
90
|
-
subagent_type="dna-${toKebabCase(roleName)}",
|
|
91
|
-
prompt="${escapePrompt(prompt)}"
|
|
92
|
-
)
|
|
93
|
-
\`\`\`
|
|
94
|
-
|
|
95
|
-
Wait for agent to complete. Read the output.
|
|
96
|
-
${step.handoff?.produces ? `Verify produced artifacts: ${step.handoff.produces.map(p => p.description).join(', ')}` : ''}
|
|
97
|
-
`;
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### 验证方式
|
|
102
|
-
|
|
103
|
-
修复后跑 behavior-lock(home),检查 trace:
|
|
104
|
-
- agent_type 应该有值(dna-frw-scanner, dna-frw-test-writer)
|
|
105
|
-
- 不应该全是 "-"
|
|
106
|
-
|
|
107
|
-
## Acceptance Criteria
|
|
108
|
-
|
|
109
|
-
- [ ] skill-adapter.ts 生成强制 Agent() 调用格式
|
|
110
|
-
- [ ] 每步明确禁止主 session 直接执行
|
|
111
|
-
- [ ] Agent subagent_type 使用编译后的 role 名称
|
|
112
|
-
- [ ] Agent prompt 包含完整步骤 prompt + variables 替换
|
|
113
|
-
- [ ] spawn 的 agent 包含 "Do NOT spawn sub-agents" 约束
|
|
114
|
-
- [ ] handoff produces 在 Agent 完成后验证
|
|
115
|
-
- [ ] 测试:生成的 SKILL.md 包含 Agent() 调用模板
|
|
116
|
-
- [ ] 实战验证:trace 中 agent_type 有值
|