create-agdf 0.14.1 → 0.14.2

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 (112) hide show
  1. package/README.md +8 -2
  2. package/generated/plugins/agdf/.claude-plugin/plugin.json +1 -1
  3. package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
  4. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +6 -1
  5. package/generated/plugins/agdf/meta/copilot-payload-baseline.json +7 -0
  6. package/generated/plugins/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +6 -1
  7. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/local-validator.js +29 -17
  8. package/generated/plugins/agdf/runtime/create-agdf/lib/runtime/plugin-provenance.js +50 -1
  9. package/generated/plugins/agdf/runtime/create-agdf/package.json +1 -1
  10. package/generated/plugins/agdf/runtime/runtime-manifest.json +2 -2
  11. package/generated/plugins/agdf/scripts/check-runtime-integrity.mjs +2 -1
  12. package/generated/plugins/agdf/submission/openai/availability.md +1 -1
  13. package/generated/plugins/agdf/submission/openai/capability-matrix.json +1 -1
  14. package/generated/plugins/agdf/submission/openai/release-notes.md +1 -1
  15. package/generated/plugins/agdf/submission/openai/reviewer-cases.json +1 -1
  16. package/generated/plugins/copilot/agdf/.agdf-payload-inventory.json +771 -0
  17. package/generated/plugins/copilot/agdf/LICENSE +201 -0
  18. package/generated/plugins/copilot/agdf/meta/agdf-agent-router.md +129 -0
  19. package/generated/plugins/copilot/agdf/meta/agdf-constitution.md +329 -0
  20. package/generated/plugins/copilot/agdf/meta/agdf-plugin.definition.json +331 -0
  21. package/generated/plugins/copilot/agdf/meta/agdf-runtime-contract.md +16 -0
  22. package/generated/plugins/{agdf → copilot/agdf}/plugin.json +1 -1
  23. package/generated/plugins/copilot/agdf/runtime/agdf-local.js +18 -0
  24. package/generated/plugins/copilot/agdf/runtime/agdf-session-check.js +97 -0
  25. package/generated/plugins/copilot/agdf/runtime/create-agdf/NOTICE +10 -0
  26. package/generated/plugins/copilot/agdf/runtime/create-agdf/bin/agdf-validator.js +11 -0
  27. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-interaction-locales.json +512 -0
  28. package/generated/plugins/copilot/agdf/runtime/create-agdf/generated/plugins/agdf/meta/agdf-plugin.definition.json +331 -0
  29. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/command-registry.js +144 -0
  30. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/delivery-path-search-command.js +139 -0
  31. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/parse-args.js +173 -0
  32. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/runtime-context.js +83 -0
  33. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/cli/validation-handlers.js +46 -0
  34. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/delivery-map.js +301 -0
  35. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/doctor.js +272 -0
  36. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/gate-check.js +455 -0
  37. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/gate-policy.js +305 -0
  38. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/parent-reconciliation.js +284 -0
  39. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/required-files.js +9 -0
  40. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/run-state.js +217 -0
  41. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/shared.js +345 -0
  42. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-evaluation/verified-change.js +156 -0
  43. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/aggregate.js +18 -0
  44. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/gate-approval-validator.js +49 -0
  45. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/index.js +7 -0
  46. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/legacy-migration.js +95 -0
  47. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-parser.js +265 -0
  48. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-repository.js +68 -0
  49. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-resolver.js +45 -0
  50. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/control-state/run-state-writer.js +97 -0
  51. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/candidate-policy.js +99 -0
  52. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/contracts.js +237 -0
  53. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/claude.js +35 -0
  54. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/codex.js +44 -0
  55. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/opencode.js +234 -0
  56. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/prompt.js +13 -0
  57. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/evaluators/protocol.js +13 -0
  58. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/claude.js +40 -0
  59. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/codex.js +38 -0
  60. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/generators/protocol.js +12 -0
  61. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/persistence.js +39 -0
  62. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/scoring.js +21 -0
  63. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/search-engine.js +155 -0
  64. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/state-adapter.js +161 -0
  65. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/surfaces/capabilities.js +27 -0
  66. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/delivery-path-search/transports/read-only-guard.js +43 -0
  67. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/interaction-presentation.js +842 -0
  68. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/local-validator.js +239 -0
  69. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/plugin-provenance.js +255 -0
  70. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime/validator-application.js +40 -0
  71. package/generated/plugins/copilot/agdf/runtime/create-agdf/lib/runtime-check-consent/contract.js +73 -0
  72. package/generated/plugins/copilot/agdf/runtime/create-agdf/package.json +6 -0
  73. package/generated/plugins/copilot/agdf/runtime/runtime-manifest.json +8 -0
  74. package/generated/submissions/openai/agdf/.codex-plugin/plugin.json +1 -1
  75. package/generated/submissions/openai/agdf/meta/agdf-plugin.definition.json +6 -1
  76. package/generated/submissions/openai/agdf/meta/copilot-payload-baseline.json +7 -0
  77. package/generated/submissions/openai/agdf/submission/openai/availability.md +1 -1
  78. package/generated/submissions/openai/agdf/submission/openai/capability-matrix.json +1 -1
  79. package/generated/submissions/openai/agdf/submission/openai/inventory.json +13 -9
  80. package/generated/submissions/openai/agdf/submission/openai/listing.json +1 -1
  81. package/generated/submissions/openai/agdf/submission/openai/readiness.json +2 -2
  82. package/generated/submissions/openai/agdf/submission/openai/readiness.md +2 -2
  83. package/generated/submissions/openai/agdf/submission/openai/release-notes.md +1 -1
  84. package/generated/submissions/openai/agdf/submission/openai/reviewer-cases.json +1 -1
  85. package/lib/installers/local-marketplace.js +112 -30
  86. package/lib/installers/plugin-installers.js +45 -9
  87. package/lib/public-plugin/copilot-profile.js +126 -0
  88. package/lib/release/version-coherence.js +4 -1
  89. package/lib/runtime/local-validator.js +29 -17
  90. package/lib/runtime/plugin-provenance.js +50 -1
  91. package/package.json +3 -2
  92. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-brownfield-analysis/SKILL.md +0 -0
  93. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-clean-implementation-review/SKILL.md +0 -0
  94. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-code-review/SKILL.md +0 -0
  95. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-delivery-closeout/SKILL.md +0 -0
  96. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-delivery-path-search/SKILL.md +0 -0
  97. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-gate-check/SKILL.md +0 -0
  98. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-interaction-locales.json +0 -0
  99. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-qa-gate/SKILL.md +0 -0
  100. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-release-or/SKILL.md +0 -0
  101. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-runtime-contract.md +0 -0
  102. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-task-plan-review/SKILL.md +0 -0
  103. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/agdf-ux-intent-definition/SKILL.md +0 -0
  104. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/closeout.md +0 -0
  105. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/context-graph.md +0 -0
  106. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/control-scaffold.md +0 -0
  107. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/gate-transition.md +0 -0
  108. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/interaction.md +0 -0
  109. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/modes.md +0 -0
  110. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/quality.md +0 -0
  111. /package/generated/plugins/{agdf → copilot/agdf}/copilot-skills/contracts/task-target-resolution.md +0 -0
  112. /package/generated/plugins/{agdf → copilot/agdf}/hooks/copilot-hooks.json +0 -0
@@ -0,0 +1,161 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+ import {
4
+ CONTRACT_VERSION,
5
+ GENERATOR_CONTRACT_VERSION,
6
+ validateGeneratorRequest,
7
+ } from "./contracts.js";
8
+ import { resolveRuns, verifyLegacyProjection } from "../control-state/index.js";
9
+
10
+ function section(content, heading) {
11
+ return (
12
+ content.match(
13
+ new RegExp(`## ${heading}\\r?\\n([\\s\\S]*?)(?=\\r?\\n## |$)`),
14
+ )?.[1] ?? ""
15
+ );
16
+ }
17
+
18
+ function tableAnswers(content) {
19
+ const answers = {};
20
+ for (const line of section(content, "Current Control State").split(/\r?\n/)) {
21
+ const cells = line
22
+ .split("|")
23
+ .slice(1, -1)
24
+ .map((cell) => cell.trim());
25
+ if (
26
+ cells.length >= 2 &&
27
+ cells[0] &&
28
+ !cells[0].startsWith("---") &&
29
+ cells[0] !== "Question"
30
+ )
31
+ answers[cells[0]] = cells[1];
32
+ }
33
+ return answers;
34
+ }
35
+
36
+ function statusCard(content) {
37
+ const card = {};
38
+ for (const line of section(content, "Run Status Card").split(/\r?\n/)) {
39
+ const cells = line
40
+ .split("|")
41
+ .slice(1, -1)
42
+ .map((cell) => cell.trim().replace(/^`|`$/g, ""));
43
+ if (
44
+ cells.length >= 2 &&
45
+ cells[0] &&
46
+ !cells[0].startsWith("---") &&
47
+ cells[0] !== "Run status"
48
+ )
49
+ card[cells[0]] = cells[1];
50
+ }
51
+ return card;
52
+ }
53
+
54
+ function listCell(value) {
55
+ return String(value ?? "")
56
+ .split(/\s*;\s*/)
57
+ .map((item) => item.trim())
58
+ .filter(Boolean);
59
+ }
60
+
61
+ export function searchInputFromControl(targetDir, options = {}) {
62
+ const canonicalRoot = join(targetDir, ".agdf", "control", "runs");
63
+ if (existsSync(canonicalRoot)) {
64
+ const projection = verifyLegacyProjection(targetDir);
65
+ if (!["absent", "valid"].includes(projection.status)) {
66
+ throw new Error(`AGDF_LEGACY_PROJECTION_DRIFT:${projection.status}`);
67
+ }
68
+ }
69
+ const resolved = existsSync(canonicalRoot)
70
+ ? resolveRuns(targetDir, {
71
+ runIdArg: options.scopeKey,
72
+ runIdEnv: process.env.AGDF_RUN_ID,
73
+ })
74
+ : null;
75
+ const runPath =
76
+ resolved?.run.path ?? join(targetDir, ".agdf", "control", "AGDF_RUN.md");
77
+ if (!existsSync(runPath)) throw new Error("missing AGDF run state");
78
+ const content = readFileSync(runPath, "utf8");
79
+ const meta = Object.fromEntries(
80
+ [...content.matchAll(/^- ([a-z_]+):\s*(.+)$/gm)].map((match) => [
81
+ match[1],
82
+ match[2].replace(/^`|`$/g, "").trim(),
83
+ ]),
84
+ );
85
+ const answers = tableAnswers(content);
86
+ const card = statusCard(content);
87
+ const result = {
88
+ contract_version: CONTRACT_VERSION,
89
+ scope_key: options.scopeKey ?? meta.run_id ?? "unknown-scope",
90
+ objective: section(content, "Objective").trim(),
91
+ current_gate: card["Current gate"] ?? meta.current_gate ?? "unknown",
92
+ allowed_actions: options.allowedActions ?? listCell(card["Allowed now"]),
93
+ forbidden_actions:
94
+ options.forbiddenActions ??
95
+ listCell(answers["What is explicitly forbidden right now?"]),
96
+ evidence_refs: [
97
+ ...content.matchAll(
98
+ /\|\s*([^|]+)\s*\|\s*([^|]+)\s*\|\s*([^|]+)\s*\|\s*(direct|indirect)\s*\|/g,
99
+ ),
100
+ ]
101
+ .slice(1)
102
+ .map((match) => `${match[1].trim()}: ${match[2].trim()}`),
103
+ risks: section(content, "Risks")
104
+ .split(/\r?\n/)
105
+ .filter(
106
+ (line) =>
107
+ line.startsWith("|") &&
108
+ !line.includes("---") &&
109
+ !line.includes("| Risk |"),
110
+ )
111
+ .map((line) => line.split("|")[1].trim()),
112
+ enforcement: options.enforcement ?? {
113
+ level: "instruction_only",
114
+ evidence: ["surface instruction prohibits implementation during search"],
115
+ },
116
+ budgets: {
117
+ max_candidates: options.maxCandidates ?? 5,
118
+ max_depth: options.maxDepth ?? 2,
119
+ max_evaluations: options.maxEvaluations ?? 8,
120
+ max_duration_ms: options.maxDurationMs ?? 120000,
121
+ max_cost_units: options.maxCostUnits ?? 20,
122
+ stability_window: options.stabilityWindow ?? 3,
123
+ },
124
+ };
125
+ if (options.generation?.enabled)
126
+ result.generation = {
127
+ enabled: true,
128
+ max_calls: 1,
129
+ max_proposals: options.generation.maxProposals ?? 5,
130
+ max_duration_ms: options.generation.maxDurationMs ?? 30000,
131
+ max_cost_units: options.generation.maxCostUnits ?? 5,
132
+ };
133
+ return result;
134
+ }
135
+
136
+ export function generatorRequestFromInput(input) {
137
+ return validateGeneratorRequest({
138
+ contract_version: GENERATOR_CONTRACT_VERSION,
139
+ scope_key: input.scope_key,
140
+ objective: input.objective,
141
+ scope_summary: input.objective,
142
+ current_gate: input.current_gate,
143
+ allowed_actions: input.allowed_actions,
144
+ forbidden_actions: input.forbidden_actions,
145
+ artefact_refs: [],
146
+ evidence: input.evidence_refs ?? [],
147
+ missing_evidence: [],
148
+ risks: input.risks ?? [],
149
+ constraints: [
150
+ "advisory only",
151
+ "canonical gate-check remains authoritative",
152
+ ],
153
+ enforcement: input.enforcement,
154
+ budgets: {
155
+ max_calls: input.generation.max_calls,
156
+ max_proposals: input.generation.max_proposals,
157
+ max_duration_ms: input.generation.max_duration_ms,
158
+ max_cost_units: input.generation.max_cost_units,
159
+ },
160
+ });
161
+ }
@@ -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
+ }