create-agdf 0.14.1 → 0.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +13 -3
  2. package/generated/.opencode/contracts/control-scaffold.md +17 -2
  3. package/generated/.opencode/skills/agdf-delivery-path-search/SKILL.md +16 -4
  4. package/generated/plugins/agdf/.claude-plugin/plugin.json +1 -1
  5. package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
  6. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +6 -1
  7. package/generated/plugins/agdf/meta/contracts/control-scaffold.md +17 -2
  8. package/generated/plugins/agdf/meta/copilot-payload-baseline.json +7 -0
  9. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +6 -1
  10. package/generated/plugins/agdf/runtime/create-agdf/lib/cli/delivery-path-search-command.js +51 -19
  11. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/contracts.js +37 -0
  12. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/persistence.js +14 -2
  13. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/search-engine.js +126 -36
  14. package/generated/plugins/agdf/runtime/create-agdf/lib/delivery-path-search/state-adapter.js +40 -92
  15. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/local-validator.js +29 -17
  16. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/plugin-provenance.js +50 -1
  17. package/generated/plugins/agdf/runtime/create-agdf/package.json +1 -1
  18. package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
  19. package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +2 -1
  20. package/generated/plugins/agdf/skills/delivery-path-search/SKILL.md +16 -4
  21. package/generated/plugins/agdf/submission/openai/availability.md +1 -1
  22. package/generated/plugins/agdf/submission/openai/capability-matrix.json +1 -1
  23. package/generated/plugins/agdf/submission/openai/release-notes.md +7 -1
  24. package/generated/plugins/agdf/submission/openai/reviewer-cases.json +1 -1
  25. package/generated/plugins/copilot/agdf/.agdf-payload-inventory.json +771 -0
  26. package/generated/plugins/copilot/agdf/LICENSE +201 -0
  27. package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-delivery-path-search/SKILL.md +16 -4
  28. package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/control-scaffold.md +17 -2
  29. package/generated/plugins/copilot/agdf/meta/agdf-agent-router.md +129 -0
  30. package/generated/plugins/copilot/agdf/meta/agdf-constitution.md +329 -0
  31. package/generated/plugins/copilot/agdf/meta/agdf-plugin.definition.json +331 -0
  32. package/generated/plugins/copilot/agdf/meta/agdf-runtime-contract.md +16 -0
  33. package/generated/plugins/{agdf → copilot/agdf}/plugin.json +1 -1
  34. package/generated/plugins/copilot/agdf/runtime/agdf-local.js +18 -0
  35. package/generated/plugins/copilot/agdf/runtime/agdf-session-check.js +97 -0
  36. package/generated/plugins/copilot/agdf/runtime/create-agdf/NOTICE +10 -0
  37. package/generated/plugins/copilot/agdf/runtime/create-agdf/bin/agdf-validator.js +11 -0
  38. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +512 -0
  39. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +331 -0
  40. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/command-registry.js +144 -0
  41. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/delivery-path-search-command.js +171 -0
  42. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/parse-args.js +173 -0
  43. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/runtime-context.js +83 -0
  44. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +46 -0
  45. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/delivery-map.js +301 -0
  46. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/doctor.js +272 -0
  47. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/gate-check.js +455 -0
  48. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/gate-policy.js +305 -0
  49. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/parent-reconciliation.js +284 -0
  50. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/required-files.js +9 -0
  51. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/run-state.js +217 -0
  52. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/shared.js +345 -0
  53. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/verified-change.js +156 -0
  54. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/aggregate.js +18 -0
  55. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/gate-approval-validator.js +49 -0
  56. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/index.js +7 -0
  57. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/legacy-migration.js +95 -0
  58. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-parser.js +265 -0
  59. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-repository.js +68 -0
  60. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-resolver.js +45 -0
  61. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-writer.js +97 -0
  62. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/candidate-policy.js +99 -0
  63. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/contracts.js +274 -0
  64. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/claude.js +35 -0
  65. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/codex.js +44 -0
  66. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/opencode.js +234 -0
  67. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/prompt.js +13 -0
  68. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/protocol.js +13 -0
  69. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/claude.js +40 -0
  70. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/codex.js +38 -0
  71. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/protocol.js +12 -0
  72. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/persistence.js +51 -0
  73. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/scoring.js +21 -0
  74. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/search-engine.js +245 -0
  75. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/state-adapter.js +109 -0
  76. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/surfaces/capabilities.js +27 -0
  77. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/transports/read-only-guard.js +43 -0
  78. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/interaction-presentation.js +842 -0
  79. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/local-validator.js +239 -0
  80. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/plugin-provenance.js +255 -0
  81. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/validator-application.js +40 -0
  82. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime-check-consent/contract.js +73 -0
  83. package/generated/plugins/copilot/agdf/runtime/create-agdf/package.json +6 -0
  84. package/generated/plugins/copilot/agdf/runtime/runtime-manifest.json +8 -0
  85. package/generated/submissions/openai/agdf/.codex-plugin/plugin.json +1 -1
  86. package/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json +6 -1
  87. package/generated/submissions/openai/agdf/meta/contracts/control-scaffold.md +17 -2
  88. package/generated/submissions/openai/agdf/meta/copilot-payload-baseline.json +7 -0
  89. package/generated/submissions/openai/agdf/skills/delivery-path-search/SKILL.md +16 -4
  90. package/generated/submissions/openai/agdf/submission/openai/availability.md +1 -1
  91. package/generated/submissions/openai/agdf/submission/openai/capability-matrix.json +1 -1
  92. package/generated/submissions/openai/agdf/submission/openai/inventory.json +15 -11
  93. package/generated/submissions/openai/agdf/submission/openai/listing.json +1 -1
  94. package/generated/submissions/openai/agdf/submission/openai/readiness.json +2 -2
  95. package/generated/submissions/openai/agdf/submission/openai/readiness.md +2 -2
  96. package/generated/submissions/openai/agdf/submission/openai/release-notes.md +7 -1
  97. package/generated/submissions/openai/agdf/submission/openai/reviewer-cases.json +1 -1
  98. package/lib/cli/delivery-path-search-command.js +51 -19
  99. package/lib/delivery-path-search/contracts.js +37 -0
  100. package/lib/delivery-path-search/persistence.js +14 -2
  101. package/lib/delivery-path-search/search-engine.js +126 -36
  102. package/lib/delivery-path-search/state-adapter.js +40 -92
  103. package/lib/installers/local-marketplace.js +112 -30
  104. package/lib/installers/plugin-installers.js +45 -9
  105. package/lib/public-plugin/copilot-profile.js +126 -0
  106. package/lib/release/version-coherence.js +4 -1
  107. package/lib/runtime/local-validator.js +29 -17
  108. package/lib/runtime/plugin-provenance.js +50 -1
  109. package/package.json +3 -2
  110. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-brownfield-analysis/SKILL.md +0 -0
  111. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-clean-implementation-review/SKILL.md +0 -0
  112. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-code-review/SKILL.md +0 -0
  113. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-delivery-closeout/SKILL.md +0 -0
  114. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-gate-check/SKILL.md +0 -0
  115. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-interaction-locales.json +0 -0
  116. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-qa-gate/SKILL.md +0 -0
  117. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-release-or/SKILL.md +0 -0
  118. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-runtime-contract.md +0 -0
  119. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-task-plan-review/SKILL.md +0 -0
  120. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-ux-intent-definition/SKILL.md +0 -0
  121. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/closeout.md +0 -0
  122. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/context-graph.md +0 -0
  123. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/gate-transition.md +0 -0
  124. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/interaction.md +0 -0
  125. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/modes.md +0 -0
  126. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/quality.md +0 -0
  127. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/task-target-resolution.md +0 -0
  128. /package/generated/plugins/{agdf → copilot/agdf}/hooks/copilot-hooks.json +0 -0
@@ -0,0 +1,109 @@
1
+ import {
2
+ CONTRACT_VERSION,
3
+ GENERATOR_CONTRACT_VERSION,
4
+ validateGeneratorRequest,
5
+ } from "./contracts.js";
6
+ import { evaluateGateCheck } from "../control-evaluation/gate-check.js";
7
+ import { readRunState } from "../control-evaluation/run-state.js";
8
+
9
+ function section(content, heading) {
10
+ return (
11
+ content.match(
12
+ new RegExp(`## ${heading}\\r?\\n([\\s\\S]*?)(?=\\r?\\n## |$)`),
13
+ )?.[1] ?? ""
14
+ );
15
+ }
16
+
17
+ function metaField(content, name) {
18
+ return content.match(new RegExp(`^- ${name}:\\s*(.+)$`, "m"))?.[1]
19
+ ?.replace(/^`|`$/g, "")
20
+ .trim() ?? "";
21
+ }
22
+
23
+ export function searchInputFromControl(targetDir, options = {}, dependencies = {}) {
24
+ const evaluate = dependencies.evaluateGateCheck ?? evaluateGateCheck;
25
+ const readRun = dependencies.readRunState ?? readRunState;
26
+ const selection = options.scopeKey ? { runId: options.scopeKey } : {};
27
+ const gate = evaluate(targetDir, selection);
28
+ const run = readRun(targetDir, selection);
29
+ const content = run.content ?? "";
30
+ const evaluatedRunId = gate.status_card?.run_id ?? "";
31
+ const evaluatedRevision = gate.status_presentation?.revision_id ?? "";
32
+ const runId = metaField(content, "run_id");
33
+ const runRevision = metaField(content, "revision_id");
34
+ const runGate = metaField(content, "current_gate");
35
+ let inputFailureCode = "";
36
+ if (!content || run.resolution_error) inputFailureCode = "canonical_control_unavailable";
37
+ else if (!evaluatedRunId || !evaluatedRevision) inputFailureCode = "canonical_snapshot_identity_missing";
38
+ else if (evaluatedRunId !== runId || evaluatedRevision !== runRevision || gate.current_gate !== runGate) {
39
+ inputFailureCode = "stale_control_snapshot";
40
+ } else if (!Array.isArray(gate.allowed) || gate.allowed.length === 0) {
41
+ inputFailureCode = "canonical_actions_unavailable";
42
+ }
43
+ const result = {
44
+ contract_version: CONTRACT_VERSION,
45
+ scope_key: evaluatedRunId || runId || options.scopeKey || "unknown-scope",
46
+ scope_revision: evaluatedRevision || runRevision || "unversioned",
47
+ objective: section(content, "Objective").trim() || "Canonical Delivery Path Search input unavailable",
48
+ current_gate: gate.current_gate || runGate || "unknown",
49
+ allowed_actions: inputFailureCode ? [] : [...gate.allowed],
50
+ forbidden_actions: Array.isArray(gate.forbidden) ? [...gate.forbidden] : [],
51
+ evidence_refs: Array.isArray(gate.evidence_refs)
52
+ ? gate.evidence_refs.map((item) => `${item.evidence}: ${item.source}`)
53
+ : [],
54
+ risks: Array.isArray(run.risks) ? run.risks.map((item) => item.risk).filter(Boolean) : [],
55
+ enforcement: options.enforcement ?? {
56
+ level: "instruction_only",
57
+ evidence: ["surface instruction prohibits implementation during search"],
58
+ },
59
+ budgets: {
60
+ max_candidates: options.maxCandidates ?? 5,
61
+ max_depth: options.maxDepth ?? 2,
62
+ max_evaluations: options.maxEvaluations ?? 8,
63
+ max_duration_ms: options.maxDurationMs ?? 120000,
64
+ max_cost_units: options.maxCostUnits ?? 20,
65
+ stability_window: options.stabilityWindow ?? 3,
66
+ },
67
+ };
68
+ if (inputFailureCode) {
69
+ result.input_failure_code = inputFailureCode;
70
+ result.input_failure_detail = run.resolution_error || (gate.blocking_reason !== "none" ? gate.blocking_reason : "") || "canonical input is not ready";
71
+ result.input_recovery_action = gate.next_allowed_action || "Run canonical AGDF gate-check and repair the selected control state.";
72
+ }
73
+ if (options.generation?.enabled)
74
+ result.generation = {
75
+ enabled: true,
76
+ max_calls: 1,
77
+ max_proposals: options.generation.maxProposals ?? 5,
78
+ max_duration_ms: options.generation.maxDurationMs ?? 30000,
79
+ max_cost_units: options.generation.maxCostUnits ?? 5,
80
+ };
81
+ return result;
82
+ }
83
+
84
+ export function generatorRequestFromInput(input) {
85
+ return validateGeneratorRequest({
86
+ contract_version: GENERATOR_CONTRACT_VERSION,
87
+ scope_key: input.scope_key,
88
+ objective: input.objective,
89
+ scope_summary: input.objective,
90
+ current_gate: input.current_gate,
91
+ allowed_actions: input.allowed_actions,
92
+ forbidden_actions: input.forbidden_actions,
93
+ artefact_refs: [],
94
+ evidence: input.evidence_refs ?? [],
95
+ missing_evidence: [],
96
+ risks: input.risks ?? [],
97
+ constraints: [
98
+ "advisory only",
99
+ "canonical gate-check remains authoritative",
100
+ ],
101
+ enforcement: input.enforcement,
102
+ budgets: {
103
+ max_calls: input.generation.max_calls,
104
+ max_proposals: input.generation.max_proposals,
105
+ max_duration_ms: input.generation.max_duration_ms,
106
+ max_cost_units: input.generation.max_cost_units,
107
+ },
108
+ });
109
+ }
@@ -0,0 +1,27 @@
1
+ import { validateEnforcement } from "../contracts.js";
2
+
3
+ export function enforcementForSurface(surface, evidence = [], context = {}) {
4
+ const defaults = {
5
+ codex: { level: "tool_enforced", evidence: ["codex exec --sandbox read-only --ephemeral"] },
6
+ claude: { level: "tool_enforced", evidence: ["claude -p --disallowedTools Edit,Write,Bash"] },
7
+ copilot: { level: "instruction_only", evidence: [] },
8
+ opencode: { level: "instruction_only", evidence: [] },
9
+ generic: { level: "instruction_only", evidence: [] },
10
+ };
11
+ const selected = structuredClone(defaults[surface] ?? defaults.generic);
12
+ if (surface === "opencode") {
13
+ const preflight = context.preflight;
14
+ if (preflight?.surface === "opencode"
15
+ && preflight.status === "passed"
16
+ && typeof preflight.invocation_id === "string"
17
+ && preflight.invocation_id
18
+ && Array.isArray(preflight.evidence)
19
+ && preflight.evidence === evidence) {
20
+ selected.level = "tool_enforced";
21
+ selected.evidence = [...evidence];
22
+ }
23
+ } else if (evidence.length) {
24
+ selected.evidence = evidence;
25
+ }
26
+ return validateEnforcement(selected);
27
+ }
@@ -0,0 +1,43 @@
1
+ import { execFileSync } from "node:child_process";
2
+
3
+ export function repositoryState(cwd) {
4
+ try {
5
+ return execFileSync("git", ["status", "--porcelain=v1", "-z"], {
6
+ cwd,
7
+ encoding: "utf8",
8
+ stdio: ["ignore", "pipe", "ignore"],
9
+ });
10
+ } catch {
11
+ return null;
12
+ }
13
+ }
14
+
15
+ export function guardedExecFileSync(file, args, options = {}) {
16
+ const before = repositoryState(options.cwd);
17
+ let output;
18
+ let failure;
19
+ try {
20
+ output = execFileSync(file, args, {
21
+ ...options,
22
+ encoding: options.encoding ?? "utf8",
23
+ stdio: options.stdio ?? ["ignore", "pipe", "pipe"],
24
+ timeout: options.timeout ?? 30000,
25
+ killSignal: "SIGTERM",
26
+ });
27
+ } catch (error) {
28
+ failure = error;
29
+ }
30
+ const after = repositoryState(options.cwd);
31
+ if (before !== null && after !== before) {
32
+ const error = new Error("repository mutation detected during read-only run");
33
+ error.code = "GENERATOR_MUTATION_DETECTED";
34
+ throw error;
35
+ }
36
+ if (failure?.code === "ETIMEDOUT" || failure?.signal === "SIGTERM") {
37
+ const timeout = new Error("read-only process timed out");
38
+ timeout.code = "GENERATOR_TIMEOUT";
39
+ throw timeout;
40
+ }
41
+ if (failure) throw failure;
42
+ return output;
43
+ }