create-agdf 0.11.4 → 0.12.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 (56) hide show
  1. package/README.md +1 -1
  2. package/generated/.agdf/control/templates/artefacts/BROWNFIELD_REVIEW.md +25 -0
  3. package/generated/.github/skills/agdf-brownfield-analysis/SKILL.md +26 -0
  4. package/generated/.github/skills/agdf-gate-check/SKILL.md +40 -18
  5. package/generated/.github/skills/agdf-interaction-locales.json +50 -0
  6. package/generated/.github/skills/agdf-runtime-contract.md +1 -0
  7. package/generated/.github/skills/contracts/gate-transition.md +7 -3
  8. package/generated/.github/skills/contracts/interaction.md +22 -0
  9. package/generated/.github/skills/contracts/modes.md +81 -0
  10. package/generated/.github/skills/contracts/task-target-resolution.md +102 -0
  11. package/generated/.opencode/AGDF.md +2 -0
  12. package/generated/.opencode/agdf-interaction-locales.json +50 -0
  13. package/generated/.opencode/agdf-runtime-contract.md +1 -0
  14. package/generated/.opencode/contracts/gate-transition.md +7 -3
  15. package/generated/.opencode/contracts/interaction.md +22 -0
  16. package/generated/.opencode/contracts/modes.md +81 -0
  17. package/generated/.opencode/contracts/task-target-resolution.md +102 -0
  18. package/generated/.opencode/skills/agdf-brownfield-analysis/SKILL.md +26 -0
  19. package/generated/.opencode/skills/agdf-gate-check/SKILL.md +40 -18
  20. package/generated/AGENTS.md +1 -0
  21. package/generated/plugins/agdf/.claude-plugin/plugin.json +1 -1
  22. package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
  23. package/generated/plugins/agdf/control/templates/artefacts/BROWNFIELD_REVIEW.md +25 -0
  24. package/generated/plugins/agdf/meta/agdf-agent-router.md +16 -0
  25. package/generated/plugins/agdf/meta/agdf-interaction-locales.json +50 -0
  26. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
  27. package/generated/plugins/agdf/meta/agdf-runtime-contract.md +1 -0
  28. package/generated/plugins/agdf/meta/contracts/gate-transition.md +7 -3
  29. package/generated/plugins/agdf/meta/contracts/interaction.md +22 -0
  30. package/generated/plugins/agdf/meta/contracts/modes.md +81 -0
  31. package/generated/plugins/agdf/meta/contracts/task-target-resolution.md +102 -0
  32. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +50 -0
  33. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +1 -1
  34. package/generated/plugins/agdf/runtime/create-agdf/lib/control-evaluation/gate-policy.js +14 -7
  35. package/generated/plugins/agdf/runtime/create-agdf/lib/interaction-presentation.js +85 -0
  36. package/generated/plugins/agdf/runtime/create-agdf/package.json +5 -2
  37. package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
  38. package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +119 -3
  39. package/generated/plugins/agdf/skills/brownfield-analysis/SKILL.md +26 -0
  40. package/generated/plugins/agdf/skills/gate-check/SKILL.md +40 -18
  41. package/lib/cli/application.js +13 -2
  42. package/lib/control-evaluation/gate-policy.js +14 -7
  43. package/lib/installers/opencode.js +128 -1
  44. package/lib/interaction-presentation.js +85 -0
  45. package/lib/live-agent/read-only-structured.js +43 -0
  46. package/lib/proportionality-benchmark/blind-prompt.js +37 -0
  47. package/lib/proportionality-benchmark/contracts.js +120 -0
  48. package/lib/proportionality-benchmark/corpus-loader.js +110 -0
  49. package/lib/proportionality-benchmark/evaluator.js +250 -0
  50. package/lib/proportionality-benchmark/index.js +7 -0
  51. package/lib/proportionality-benchmark/live-recorder.js +100 -0
  52. package/lib/proportionality-benchmark/report.js +51 -0
  53. package/lib/proportionality-benchmark/source-fingerprint.js +30 -0
  54. package/lib/skill-evals/live-recorder.js +3 -26
  55. package/opencode-plugin.js +40 -1
  56. package/package.json +5 -2
@@ -36,6 +36,87 @@ reason, evidence and required next depth in the same internal operation. `Mode/S
36
36
  only a fail-closed recovery step for incomplete or legacy records and is not a normal second user
37
37
  decision.
38
38
 
39
+ ### Structured Depth Decision
40
+
41
+ This section is the sole normative owner for choosing between `structured_slice` and
42
+ `structured_delivery`. Apply it only after an approved durable UR, a Brownfield Review of the
43
+ existing-system context, and unchanged evaluation of Quick Task/Compact Delivery and Verified
44
+ Change. A compact path must be ineligible or explicitly escalated, and the decisive depth facts must
45
+ be durably evidenced before a positive structured decision is recorded.
46
+
47
+ Choose `structured_delivery` when any one evidenced full-depth trigger applies:
48
+
49
+ 1. **Authority, policy or security** — a trust or authority boundary, permission, security,
50
+ compliance or normative policy changes, or independent decision owners require coordinated
51
+ approval.
52
+ 2. **Architecture or runtime** — execution, orchestration, durable execution, concurrency, failure
53
+ or recovery boundaries change beyond a local slice.
54
+ 3. **Persistence, data or migration** — persistent schema or meaning changes, data migration,
55
+ irreversible state transition, coordinated cutover, an extended compatibility window or
56
+ non-local rollback is required.
57
+ 4. **External or public contract** — an external API, public CLI behavior, protocol, file format or
58
+ compatibility-sensitive integration contract changes, including independent consumer
59
+ coordination or versioning.
60
+ 5. **Release, deployment or cross-host** — the work needs its own rollout, deployment, rollback,
61
+ feature-flag or release plan, or coordinated activation across hosts, products or operational
62
+ boundaries.
63
+ 6. **Unbounded consumer or owner coordination** — the outcome cannot be delivered as an
64
+ independently acceptable and reversible slice, or consumers or owners require a shared cutover
65
+ or compatibility window.
66
+
67
+ A single trigger is decisive because of its effect, never because of a numeric count.
68
+
69
+ Choose `structured_slice` only when `depth_facts_status` is `complete`, no full-depth trigger is
70
+ evidenced, and all seven bounded-slice checks are positively evidenced as `pass`:
71
+
72
+ | Check ID | Required evidence |
73
+ |---|---|
74
+ | `coherent_outcome` | One coherent user or product outcome has a clear acceptance boundary. |
75
+ | `authority_boundary` | Authority and source of truth are known and no new trust, policy, permission or security boundary is introduced. |
76
+ | `owner_consumer_coordination` | Owners and consumers are identified and coordination stays inside the slice without a shared external cutover. |
77
+ | `full_depth_impacts_absent` | Architecture, runtime, persistence, data, external API, public CLI, release and cross-host effects are evidenced as not full-depth relevant. |
78
+ | `migration_propagation_bounded` | Migration and propagation are bounded, compatible, testable and locally reversible. |
79
+ | `failure_recovery_local` | Failure, recovery and rollback remain controllable inside the slice. |
80
+ | `independently_acceptable` | The slice has independent acceptance signals and hides no unknown later work as a prerequisite. |
81
+
82
+ Multiple files, owners, consumers or derived paths do not fail these checks by themselves. File,
83
+ owner, consumer, task or derived-path counts are not a decision proxy and must never be used as a
84
+ threshold for either structured mode.
85
+
86
+ If a decisive fact is missing or conflicting and no evidenced full-depth trigger already supports
87
+ `structured_delivery`, the product-language result is `depth_unresolved`. This is not a persisted
88
+ mode. Persist the existing Mode/Slice value `block`, use `depth_facts_missing` or
89
+ `depth_facts_conflicting`, name the affected facts and evidence owner where known, link the
90
+ Brownfield Review, forbid later artefacts and implementation, and provide a precise next action for
91
+ evidence completion and Brownfield/Mode-Slice re-evaluation. Unknown facts must not default to
92
+ `structured_delivery`.
93
+
94
+ Positive decisions persist the existing `structured_slice | structured_delivery` value, required
95
+ next gate, a `scope_reason` containing the primary reason code and decisive rationale plus the
96
+ rejected alternative, and evidence linking the complete Structured Depth Evidence. Re-evaluate
97
+ before continuing whenever scope growth reveals a new full-depth trigger.
98
+
99
+ Normalized reason codes are audit and rationale categories, not new modes or gates:
100
+
101
+ - `bounded_structured_slice`
102
+ - `authority_policy_security_depth`
103
+ - `architecture_runtime_depth`
104
+ - `persistence_migration_depth`
105
+ - `external_contract_depth`
106
+ - `release_cross_host_depth`
107
+ - `unbounded_consumer_coordination`
108
+ - `depth_facts_missing`
109
+ - `depth_facts_conflicting`
110
+
111
+ Structured Slice and Structured Delivery use the same existing gate and approval sequence. Their
112
+ difference is artefact depth: Slice artefacts cover only the coherent bounded outcome and its owners,
113
+ contracts, propagation, recovery, tasks and tests; Full Delivery covers every affected authority,
114
+ architecture, runtime, consumer, migration, operational and release boundary.
115
+
116
+ Historical or deterministic benchmark observations are non-authorizing evidence. They do not define
117
+ this policy, retroactively regrade historical runs or prove live-host behavior. A future benchmark
118
+ may apply this policy only with complete, versioned neutral depth facts.
119
+
39
120
  ### Verified Change
40
121
 
41
122
  `verified_change` is a compact, fail-closed path for a bounded user-visible change with one canonical owner and deterministic proof. It is neither a prose exception nor a new user approval gate.
@@ -0,0 +1,102 @@
1
+ # AGDF Runtime Contract — Task Target Resolution
2
+
3
+ ## Purpose And Ordering
4
+
5
+ Resolve the user's primary work target before repository activation, Scope Classification, mode
6
+ selection or gate evaluation. Repository governance is downstream of the task target; the current
7
+ working directory, an inspected repository or a source mentioned as evidence must never become the
8
+ work target by accident.
9
+
10
+ The canonical order is:
11
+
12
+ 1. resolve or revalidate the task target;
13
+ 2. derive the governance target from that resolved target;
14
+ 3. activate repository-local AGDF control only for that governance target;
15
+ 4. then apply read-only orientation, Scope Classification, mode selection and gate evaluation.
16
+
17
+ If task-target resolution is unresolved, steps 2–4 and every mutation are forbidden.
18
+
19
+ ## Resolution Result
20
+
21
+ Use one normalized result:
22
+
23
+ - `resolution_state`: `resolved | unresolved`
24
+ - `reason_code`: `explicit_target | continued_target | multiple_plausible_targets |
25
+ target_content_mismatch | target_unavailable | no_reliable_target`
26
+ - `primary_target`: exactly one requested work object when resolved, otherwise empty
27
+ - `evidence_sources`: zero or more mentioned or inspected sources that do not gain mutation authority
28
+ - `working_directory`: execution context only, never target authority by itself
29
+ - `governance_target`: the repository whose control state applies to the primary target, otherwise empty
30
+ - `target_changed`: whether an explicit new target replaced the previously confirmed target
31
+ - `next_action`: required clarification, supply or retry action when unresolved
32
+
33
+ A resolved result requires a non-empty `primary_target` and a reason code of `explicit_target` or
34
+ `continued_target`. An unresolved result requires an empty `primary_target`, an empty
35
+ `governance_target`, one of the four unresolved reason codes and a non-empty `next_action`.
36
+ Contradictory or incomplete results fail closed.
37
+
38
+ ## Target Authority Precedence
39
+
40
+ Resolve in this order:
41
+
42
+ 1. an explicit file, artefact or repository named as the work target in the current user turn;
43
+ 2. a previously confirmed target only when the current turn unambiguously continues the same action,
44
+ object and scope;
45
+ 3. the current repository or working directory only when the request explicitly or deictically asks
46
+ for work on "this project", "this repository" or an equivalent current-scope reference;
47
+ 4. otherwise `no_reliable_target`.
48
+
49
+ An explicit current-turn target always replaces an inherited target. Make the change visible when
50
+ the previous target could otherwise remain plausible.
51
+
52
+ Do not fall back to the working directory, a neighboring file or an evidence source when the
53
+ explicit target is unavailable or its content does not support the requested change.
54
+
55
+ ## Evidence And Mutation Boundary
56
+
57
+ Reading, inspecting, mentioning or relying on a repository or artefact makes it an evidence source,
58
+ not a mutation target. Evidence access never grants mutation authority and never activates that
59
+ repository's AGDF control state.
60
+
61
+ Derive `governance_target` only from:
62
+
63
+ - the repository containing the resolved `primary_target`; or
64
+ - an explicit user statement that a named repository governs the target.
65
+
66
+ An external standalone artefact may have no repository governance target. In that case the router
67
+ continues with the applicable non-repository path; it must not borrow governance from the current
68
+ working directory.
69
+
70
+ ## Continuation And Target Change
71
+
72
+ A confirmed target may continue across related turns only when the current request remains
73
+ unambiguous. Revalidate it before every mutation or gate decision. New explicit target evidence wins.
74
+ New ambiguity ends the inherited binding and produces `multiple_plausible_targets`.
75
+
76
+ When a durable AGDF run exists, its Source And Scope State may record the confirmed target as
77
+ evidence. It does not override a newer explicit user target. Outside a run, continuation remains
78
+ transient conversation state; do not create a global target store or a second run-state owner.
79
+
80
+ ## Fail-Closed States
81
+
82
+ - `multiple_plausible_targets`: more than one work target remains plausible; list the candidates and
83
+ request the smallest clarification.
84
+ - `target_content_mismatch`: the requested content change is not supported by the explicit target's
85
+ observable content; name the mismatch and ask whether the target or requested change should change.
86
+ - `target_unavailable`: the named file, attachment or artefact cannot be inspected; request supply or
87
+ access and offer a visible retry.
88
+ - `no_reliable_target`: neither an explicit target nor an unambiguous continuation exists; request a
89
+ target.
90
+
91
+ These states forbid repository activation, Scope Classification, gate evaluation and mutation.
92
+ Never silently expand scope to make the request fit a different project.
93
+
94
+ ## Presentation Boundary
95
+
96
+ `contracts/interaction.md` owns the visible, non-authorizing Task Target Orientation.
97
+ `create-agdf/lib/interaction-presentation.js` owns its rendering. The renderer projects a normalized
98
+ result; it must not resolve targets, derive governance or become a state store.
99
+
100
+ Show orientation when target/context separation is material, when the target changes, or when the
101
+ result is unresolved. Avoid redundant presentation for an obvious unchanged target. Presentation
102
+ never grants mutation or gate authority.
@@ -58,6 +58,31 @@
58
58
  "escalation": "Escalation triggers",
59
59
  "challenge": "Challenge path"
60
60
  },
61
+ "taskTargetResolution": {
62
+ "title": "AGDF task target",
63
+ "field": "Field",
64
+ "value": "Value",
65
+ "state": "Resolution",
66
+ "resolved": "Resolved",
67
+ "unresolved": "Clarification required",
68
+ "primaryTarget": "Primary target",
69
+ "governanceTarget": "Governance target",
70
+ "evidenceSources": "Evidence sources",
71
+ "workingDirectory": "Working directory",
72
+ "targetChanged": "Target changed",
73
+ "yes": "yes",
74
+ "none": "none",
75
+ "reason": "Reason",
76
+ "nextAction": "Next action",
77
+ "reasonCodes": {
78
+ "explicit_target": "Explicit current-turn target",
79
+ "continued_target": "Confirmed target continued",
80
+ "multiple_plausible_targets": "Multiple plausible work targets",
81
+ "target_content_mismatch": "Requested change mismatches target",
82
+ "target_unavailable": "Named target is unavailable",
83
+ "no_reliable_target": "No reliable work target"
84
+ }
85
+ },
61
86
  "internalStateLabels": {
62
87
  "verifiedChange": "Compact change under review",
63
88
  "verifiedChangeEscalated": "Escalated to structured delivery",
@@ -284,6 +309,31 @@
284
309
  "escalation": "Eskalationsauslöser",
285
310
  "challenge": "Widerspruchspfad"
286
311
  },
312
+ "taskTargetResolution": {
313
+ "title": "AGDF-Arbeitsziel",
314
+ "field": "Feld",
315
+ "value": "Wert",
316
+ "state": "Auflösung",
317
+ "resolved": "Aufgelöst",
318
+ "unresolved": "Klärung erforderlich",
319
+ "primaryTarget": "Primäres Ziel",
320
+ "governanceTarget": "Governance-Ziel",
321
+ "evidenceSources": "Evidenzquellen",
322
+ "workingDirectory": "Arbeitsordner",
323
+ "targetChanged": "Ziel gewechselt",
324
+ "yes": "ja",
325
+ "none": "keines",
326
+ "reason": "Grund",
327
+ "nextAction": "Nächste Aktion",
328
+ "reasonCodes": {
329
+ "explicit_target": "Explizites Ziel im aktuellen Turn",
330
+ "continued_target": "Bestätigtes Ziel wird fortgesetzt",
331
+ "multiple_plausible_targets": "Mehrere plausible Arbeitsziele",
332
+ "target_content_mismatch": "Änderung passt nicht zum Zielinhalt",
333
+ "target_unavailable": "Benanntes Ziel ist nicht verfügbar",
334
+ "no_reliable_target": "Kein belastbares Arbeitsziel"
335
+ }
336
+ },
287
337
  "internalStateLabels": {
288
338
  "verifiedChange": "Kompakte Änderung wird geprüft",
289
339
  "verifiedChangeEscalated": "Eskaliert zu structured delivery",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "id": "agdf",
4
- "version": "0.11.4",
4
+ "version": "0.12.0",
5
5
  "displayName": "AI Governance & Delivery Framework",
6
6
  "developerName": "Arndt Gold",
7
7
  "description": "Operating system for governed AI-assisted delivery.",
@@ -29,8 +29,9 @@ export function isGateSatisfied(runState, gate) {
29
29
  return isDurableGateArtefactSatisfied(runState, gate);
30
30
  }
31
31
 
32
- function qaRevisionRequired(runState) {
33
- return gateArtefactStatus(runState, "QA").status === "revise";
32
+ function qaNonPassDecision(runState) {
33
+ const status = gateArtefactStatus(runState, "QA").status;
34
+ return status === "revise" || status === "block" ? status : null;
34
35
  }
35
36
 
36
37
  export function transitionDecisionForRunState(runState, verifiedChange = null) {
@@ -233,15 +234,21 @@ export function transitionDecisionForRunState(runState, verifiedChange = null) {
233
234
  };
234
235
  }
235
236
 
236
- if (qaRevisionRequired(runState)) {
237
+ const qaNonPass = qaNonPassDecision(runState);
238
+ if (qaNonPass) {
239
+ const blocked = qaNonPass === "block";
237
240
  return {
238
- status: "open",
241
+ status: blocked ? "blocked" : "open",
239
242
  current_gate: "QA",
240
- blocking_reason: "qa_revise_required",
243
+ blocking_reason: blocked ? "qa_blocked" : "qa_revise_required",
241
244
  missing_approval: "none",
242
- allowed: ["revise the implementation against the QA findings", "refresh CD+Tests and mandatory reviews", "rerun QA with refreshed evidence"],
245
+ allowed: blocked
246
+ ? ["route the blocking QA findings to their authoritative owner", "record the next permitted remediation or upstream decision", "rerun QA only after the blocker is resolved"]
247
+ : ["revise the implementation against the QA findings", "refresh CD+Tests and mandatory reviews", "rerun QA with refreshed evidence"],
243
248
  forbidden: ["request QA approval", "request UAT approval", "release", "claim delivery readiness"],
244
- next_allowed_action: "Resolve the QA revise findings, refresh CD+Tests and reviews, then rerun QA. Do not request Approval: QA from a revise report.",
249
+ next_allowed_action: blocked
250
+ ? "Resolve or route the blocking QA findings through their authoritative owner, then rerun the required delivery steps. Do not request Approval: QA from a block report."
251
+ : "Resolve the QA revise findings, refresh CD+Tests and reviews, then rerun QA. Do not request Approval: QA from a revise report.",
245
252
  };
246
253
  }
247
254
 
@@ -349,6 +349,91 @@ export function renderOperationalStatusCard(statusCard, {
349
349
  });
350
350
  }
351
351
 
352
+ export function renderTaskTargetOrientation(resolution, {
353
+ registry,
354
+ requestedLocale,
355
+ } = {}) {
356
+ if (!plainObject(resolution)) return null;
357
+
358
+ const resolutionState = String(resolution.resolution_state ?? "").trim();
359
+ const reasonCode = String(resolution.reason_code ?? "").trim();
360
+ const primaryTarget = String(resolution.primary_target ?? "").trim();
361
+ const governanceTarget = String(resolution.governance_target ?? "").trim();
362
+ const workingDirectory = String(resolution.working_directory ?? "").trim();
363
+ const nextAction = String(resolution.next_action ?? "").trim();
364
+ if (typeof resolution.target_changed !== "boolean") return null;
365
+ const targetChanged = resolution.target_changed === true;
366
+ const evidenceSources = Array.isArray(resolution.evidence_sources)
367
+ ? resolution.evidence_sources.map((item) => String(item ?? "").trim()).filter(Boolean)
368
+ : null;
369
+
370
+ const resolvedReasons = new Set(["explicit_target", "continued_target"]);
371
+ const unresolvedReasons = new Set([
372
+ "multiple_plausible_targets",
373
+ "target_content_mismatch",
374
+ "target_unavailable",
375
+ "no_reliable_target",
376
+ ]);
377
+
378
+ if (!["resolved", "unresolved"].includes(resolutionState)) return null;
379
+ if (!workingDirectory || evidenceSources === null) return null;
380
+ if (resolutionState === "resolved") {
381
+ if (!resolvedReasons.has(reasonCode) || !primaryTarget || nextAction) return null;
382
+ } else if (!unresolvedReasons.has(reasonCode) || primaryTarget || governanceTarget || !nextAction || targetChanged) {
383
+ return null;
384
+ }
385
+
386
+ let locale;
387
+ try {
388
+ locale = resolvePresentationLocale(registry, requestedLocale);
389
+ } catch {
390
+ return null;
391
+ }
392
+ if (!locale) return null;
393
+
394
+ const pack = localePack(registry, locale);
395
+ const labels = pack?.taskTargetResolution;
396
+ if (!plainObject(labels) || !plainObject(labels.reasonCodes)) return null;
397
+ const reason = labels.reasonCodes[reasonCode];
398
+ if (!reason) return null;
399
+
400
+ const rows = resolutionState === "resolved"
401
+ ? [
402
+ [labels.state, labels.resolved],
403
+ [labels.primaryTarget, primaryTarget],
404
+ [labels.governanceTarget, governanceTarget || labels.none],
405
+ [labels.evidenceSources, evidenceSources.join("; ") || labels.none],
406
+ [labels.workingDirectory, workingDirectory],
407
+ [labels.reason, reason],
408
+ ...(targetChanged ? [[labels.targetChanged, labels.yes]] : []),
409
+ ]
410
+ : [
411
+ [labels.state, labels.unresolved],
412
+ [labels.reason, reason],
413
+ [labels.evidenceSources, evidenceSources.join("; ") || labels.none],
414
+ [labels.workingDirectory, workingDirectory],
415
+ [labels.nextAction, nextAction],
416
+ ];
417
+
418
+ const markdown = [
419
+ `## ${labels.title}`,
420
+ "",
421
+ `| ${labels.field} | ${labels.value} |`,
422
+ "|---|---|",
423
+ ...rows.map(([label, value]) => `| ${markdownCell(label)} | ${markdownCell(value)} |`),
424
+ ].join("\n");
425
+
426
+ return Object.freeze({
427
+ schema_version: "1",
428
+ semantic_block: "task_target_orientation",
429
+ presentation_language: locale,
430
+ resolution_state: resolutionState,
431
+ reason_code: reasonCode,
432
+ markdown,
433
+ authorizes: false,
434
+ });
435
+ }
436
+
352
437
  export function renderScopeClassificationCard(classification, {
353
438
  registry,
354
439
  requestedLocale,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-agdf",
3
- "version": "0.11.4",
3
+ "version": "0.12.0",
4
4
  "description": "Bootstrap AGDF repository-local plugin files, Copilot/OpenCode instructions, skills, control files and machine-readable checks.",
5
5
  "type": "module",
6
6
  "files": [
@@ -39,9 +39,12 @@
39
39
  "test:skill-evals": "node ./scripts/skill-evals-test.js",
40
40
  "eval:skills": "node ./scripts/run-skill-evals.js",
41
41
  "eval:skills:record": "node ./scripts/record-skill-evals.js",
42
+ "eval:proportionality:record": "node ./scripts/record-proportionality-benchmark.js",
43
+ "eval:proportionality": "node ./scripts/run-proportionality-benchmark.js",
44
+ "test:proportionality": "node ./scripts/proportionality-benchmark-test.js",
42
45
  "test:release-bootstrap": "node ./scripts/release-bootstrap-smoke-test.js",
43
46
  "test:routing": "npm run sync-package-assets && node ./scripts/test-routing.js",
44
- "smoke-test": "npm run sync-package-assets && npm run test:cli-modularization && npm run test:local-validator && npm run test:local-marketplace && npm run test:package-build && npm run test:package-contents && npm run test:lifecycle && npm run test:control-state && npm run test:interaction-presentation && npm run test:verified-change && npm run test:runtime-integrity-layout && npm run test:runtime-integrity-negative && npm run test:skill-evals && npm run eval:skills && npm run test:delivery-path-search && npm run test:delivery-path-search-unit && npm run test:delivery-path-search-generator && npm run test:opencode-hardening && node ./scripts/smoke-test.js && node ./scripts/test-routing.js",
47
+ "smoke-test": "npm run sync-package-assets && npm run test:cli-modularization && npm run test:local-validator && npm run test:local-marketplace && npm run test:package-build && npm run test:package-contents && npm run test:lifecycle && npm run test:control-state && npm run test:interaction-presentation && npm run test:verified-change && npm run test:runtime-integrity-layout && npm run test:runtime-integrity-negative && npm run test:skill-evals && npm run eval:skills && npm run test:proportionality && npm run test:delivery-path-search && npm run test:delivery-path-search-unit && npm run test:delivery-path-search-generator && npm run test:opencode-hardening && node ./scripts/smoke-test.js && node ./scripts/test-routing.js",
45
48
  "prepack": "npm run sync-package-assets"
46
49
  },
47
50
  "keywords": [
@@ -2,7 +2,7 @@
2
2
  "schema_version": "1",
3
3
  "generated": true,
4
4
  "source": "create-agdf/cli",
5
- "version": "0.11.4",
5
+ "version": "0.12.0",
6
6
  "entrypoint": "create-agdf/bin/agdf-validator.js",
7
- "digest": "a3dcdf6d1b66e4789ab10339253e69b967d2d4f2421b52a1d50212e9a8553ec1"
7
+ "digest": "a869279122dd6a2a7de6a5c719e41eedea5e89b7a2ee32012f7d74ce778ff24e"
8
8
  }
@@ -92,6 +92,7 @@ const agentRouterPath = join(pluginRoot, "meta", "agdf-agent-router.md");
92
92
  const runtimeContractPath = join(pluginRoot, "meta", "agdf-runtime-contract.md");
93
93
  const contractsDir = join(pluginRoot, "meta", "contracts");
94
94
  const contractModules = [
95
+ "task-target-resolution.md",
95
96
  "gate-transition.md",
96
97
  "interaction.md",
97
98
  "modes.md",
@@ -331,12 +332,66 @@ if (!sourceMode && isFile(localRuntimeEntrypointPath)) {
331
332
  }
332
333
  }
333
334
  const runtimeContract = readAllContracts();
335
+ const modesContract = isFile(join(contractsDir, "modes.md")) ? read(join(contractsDir, "modes.md")) : "";
336
+ const gateTransitionContract = isFile(join(contractsDir, "gate-transition.md")) ? read(join(contractsDir, "gate-transition.md")) : "";
337
+ const agentRouterContent = isFile(agentRouterPath) ? read(agentRouterPath) : "";
334
338
  const interactionLocales = isFile(interactionLocalesPath) ? readJson(interactionLocalesPath, "interaction locale registry") : null;
335
339
  const gateCheckSkill = isFile(gateCheckSkillPath) ? read(gateCheckSkillPath) : "";
336
340
  const brownfieldSkill = isFile(brownfieldSkillPath) ? read(brownfieldSkillPath) : "";
337
341
  if (!brownfieldSkill.includes("Persist the completed review and its decision, scope reason, evidence and required next gate in the same internal operation")) {
338
342
  failures.push("brownfield-analysis must own atomic post-UR review and routing persistence");
339
343
  }
344
+ for (const required of [
345
+ "### Structured Depth Decision",
346
+ "depth_unresolved",
347
+ "depth_facts_status",
348
+ "bounded_structured_slice",
349
+ "authority_policy_security_depth",
350
+ "architecture_runtime_depth",
351
+ "persistence_migration_depth",
352
+ "external_contract_depth",
353
+ "release_cross_host_depth",
354
+ "unbounded_consumer_coordination",
355
+ "depth_facts_missing",
356
+ "depth_facts_conflicting",
357
+ "coherent_outcome",
358
+ "authority_boundary",
359
+ "owner_consumer_coordination",
360
+ "full_depth_impacts_absent",
361
+ "migration_propagation_bounded",
362
+ "failure_recovery_local",
363
+ "independently_acceptable",
364
+ ]) {
365
+ if (!modesContract.includes(required)) failures.push(`modes contract Structured Depth Decision missing: ${required}`);
366
+ }
367
+ if (!modesContract.includes("counts are not a decision proxy")
368
+ || !modesContract.includes("threshold for either structured mode")) {
369
+ failures.push("modes contract must reject numeric structured-depth proxies");
370
+ }
371
+ if (!modesContract.includes("Structured Slice and Structured Delivery use the same existing gate and approval sequence")) {
372
+ failures.push("modes contract must preserve structured-depth gate parity");
373
+ }
374
+ if (!gateTransitionContract.includes("sole normative `Structured Depth Decision`")
375
+ || !gateTransitionContract.includes("does not duplicate its")
376
+ || !gateTransitionContract.includes("trigger or bounded-slice matrix")) {
377
+ failures.push("gate-transition contract must reference the Modes-owned Structured Depth Decision without duplicating it");
378
+ }
379
+ if (!gateTransitionContract.includes("`depth_unresolved` product result is persisted through this existing value")
380
+ || !gateTransitionContract.includes("`depth_facts_missing | depth_facts_conflicting`")) {
381
+ failures.push("gate-transition contract must route unresolved structured depth through the existing block value");
382
+ }
383
+ for (const required of [
384
+ "../../meta/contracts/modes.md",
385
+ "depth_policy_version: 1",
386
+ "depth_facts_status: complete",
387
+ "rejected_alternative",
388
+ "missing_or_conflicting_facts",
389
+ "all seven bounded-slice",
390
+ "the existing `block` decision",
391
+ "Brownfield/Mode-Slice re-evaluation",
392
+ ]) {
393
+ if (!brownfieldSkill.includes(required)) failures.push(`brownfield-analysis structured-depth guidance missing: ${required}`);
394
+ }
340
395
  const codexPlugin = isFile(codexPluginPath) ? readJson(codexPluginPath, "Codex plugin manifest") : null;
341
396
  const claudePlugin = isFile(claudePluginPath) ? readJson(claudePluginPath, "Claude plugin manifest") : null;
342
397
  const agdfPackage = isFile(agdfPackagePath) ? readJson(agdfPackagePath, "agdf CLI package manifest") : null;
@@ -354,13 +409,18 @@ if (!runtimeContract.includes("### Interaction Locale Contract") || !runtimeCont
354
409
  }
355
410
 
356
411
  const gateCheckOperationalBoundaries = [
412
+ "Resolve or revalidate the primary task target before selecting repository control state.",
413
+ "Derive repository activation only from the resolved governance target",
357
414
  "Select exactly one run and evaluate its current gate.",
358
415
  "Confirm that the required durable artefact is present and ready.",
359
416
  "Consume the canonical `approval_presentation` verbatim",
360
417
  "obtain deliberate input through the contract-selected native or exact-text path",
361
- "Revalidate the same run, gate and revision immediately after the response and before persistence.",
418
+ "Revalidate the same target, run, gate and revision immediately after the response and before persistence.",
362
419
  "Persist only a currently valid exact approval through the existing control-state workflow.",
363
420
  ];
421
+ if (!gateCheckSkill.includes("../../meta/contracts/task-target-resolution.md")) {
422
+ failures.push("gate-check must load the focused task-target-resolution contract");
423
+ }
364
424
  if (!gateCheckSkill.includes("../../meta/contracts/interaction.md")) {
365
425
  failures.push("gate-check must load the focused interaction contract");
366
426
  }
@@ -403,6 +463,26 @@ if (!runtimeContract.includes("### Repository Activation Diagnosis Boundary")) {
403
463
  if (!runtimeContract.includes("### Scope Classification Card")) {
404
464
  failures.push("interaction contract must own the scope classification card section");
405
465
  }
466
+ if (!runtimeContract.includes("## Purpose And Ordering")
467
+ || !runtimeContract.includes("## Target Authority Precedence")
468
+ || !runtimeContract.includes("## Evidence And Mutation Boundary")
469
+ || !runtimeContract.includes("## Fail-Closed States")) {
470
+ failures.push("task-target-resolution contract must own target precedence, evidence boundaries and fail-closed states");
471
+ }
472
+ if (!runtimeContract.includes("### Task Target Orientation")) {
473
+ failures.push("interaction contract must own the task target orientation section");
474
+ }
475
+ if (!agentRouterContent.includes("## Task Target Resolution")
476
+ || agentRouterContent.indexOf("## Task Target Resolution") > agentRouterContent.indexOf("## Mode Selection")) {
477
+ failures.push("agent router must resolve the task target before Mode Selection");
478
+ }
479
+ if (!gateCheckSkill.includes("task_target_orientation.markdown` verbatim")) {
480
+ failures.push("gate-check must consume the canonical task target orientation verbatim");
481
+ }
482
+ if (gateCheckSkill.includes("## Task Target Orientation Template")
483
+ || gateCheckSkill.includes("| Primary target | Governance target | Evidence sources |")) {
484
+ failures.push("gate-check must not maintain a skill-local task target orientation template");
485
+ }
406
486
  if (!gateCheckSkill.includes("scope_classification.markdown` verbatim")) {
407
487
  failures.push("gate-check must consume the canonical scope classification projection verbatim");
408
488
  }
@@ -415,12 +495,21 @@ if (sourceMode && isFile(interactionPresentationPath)) {
415
495
  if (!interactionPresentation.includes("export function renderScopeClassificationCard")) {
416
496
  failures.push("interaction-presentation.js must export renderScopeClassificationCard");
417
497
  }
498
+ if (!interactionPresentation.includes("export function renderTaskTargetOrientation")) {
499
+ failures.push("interaction-presentation.js must export renderTaskTargetOrientation");
500
+ }
418
501
  }
419
502
  for (const locale of ["en", "de"]) {
420
503
  const pack = interactionLocales?.locales?.[locale];
421
504
  if (!pack?.scopeClassification?.title || !pack?.scopeClassification?.mode?.quick_task || !pack?.scopeClassification?.challenge) {
422
505
  failures.push(`Interaction locale ${locale} missing scopeClassification section keys`);
423
506
  }
507
+ if (!pack?.taskTargetResolution?.title
508
+ || !pack?.taskTargetResolution?.primaryTarget
509
+ || !pack?.taskTargetResolution?.reasonCodes?.target_content_mismatch
510
+ || !pack?.taskTargetResolution?.nextAction) {
511
+ failures.push(`Interaction locale ${locale} missing taskTargetResolution section keys`);
512
+ }
424
513
  }
425
514
  if (!runtimeContract.includes("not an agent-facing diagnosis proof")) {
426
515
  failures.push("control-scaffold contract must classify AGDF_* env vars as non-agent-facing diagnosis");
@@ -902,9 +991,10 @@ for (const skill of expectedSkills) {
902
991
  for (const required of [
903
992
  "## Native Interaction Path",
904
993
  "complete normative owner for interaction kinds, locale",
994
+ "Resolve or revalidate the primary task target before selecting repository control state",
905
995
  "Select exactly one run and evaluate its current gate",
906
996
  "Confirm that the required durable artefact is present and ready",
907
- "Revalidate the same run, gate and revision immediately after the response and before persistence",
997
+ "Revalidate the same target, run, gate and revision immediately after the response and before persistence",
908
998
  "Persist only a currently valid exact approval",
909
999
  ]) {
910
1000
  if (!skillMd.includes(required)) failures.push(`gate-check native interaction guidance missing: ${required}`);
@@ -1066,7 +1156,33 @@ if (isFile(sotRegistryTemplatePath)) {
1066
1156
 
1067
1157
  if (isFile(brownfieldReviewTemplatePath)) {
1068
1158
  const brownfieldReviewTemplate = read(brownfieldReviewTemplatePath);
1069
- for (const required of ["Existing-System View", "Reuse And Parallel-Structure Risk", "Mode / Slice Decision", "transparency_note", "Next Permissible Step", "delivery_context", "ui_ux_impact", "ui_ux_impact_reason", "ux_intent_definition_required", "ux_intent_definition_result"]) {
1159
+ for (const required of [
1160
+ "Existing-System View",
1161
+ "Reuse And Parallel-Structure Risk",
1162
+ "Mode / Slice Decision",
1163
+ "transparency_note",
1164
+ "Next Permissible Step",
1165
+ "delivery_context",
1166
+ "ui_ux_impact",
1167
+ "ui_ux_impact_reason",
1168
+ "ux_intent_definition_required",
1169
+ "ux_intent_definition_result",
1170
+ "Structured Depth Evidence",
1171
+ "depth_policy_version",
1172
+ "depth_facts_status",
1173
+ "primary_reason_code",
1174
+ "decisive_full_depth_triggers",
1175
+ "rejected_alternative",
1176
+ "missing_or_conflicting_facts",
1177
+ "depth_evidence_refs",
1178
+ "coherent_outcome",
1179
+ "authority_boundary",
1180
+ "owner_consumer_coordination",
1181
+ "full_depth_impacts_absent",
1182
+ "migration_propagation_bounded",
1183
+ "failure_recovery_local",
1184
+ "independently_acceptable",
1185
+ ]) {
1070
1186
  if (!brownfieldReviewTemplate.includes(required)) failures.push(`BROWNFIELD_REVIEW.md missing control field: ${required}`);
1071
1187
  }
1072
1188
  }