rapidkit 0.41.2 → 0.41.4

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 (80) hide show
  1. package/README.md +61 -52
  2. package/contracts/agent-customization-pack.v1.json +20 -0
  3. package/contracts/artifact-remediation-plan.v1.json +163 -0
  4. package/contracts/doctor-project-evidence.v1.json +260 -2
  5. package/contracts/doctor-remediation-plan.v1.json +496 -0
  6. package/contracts/doctor-workspace-evidence.v1.json +260 -2
  7. package/contracts/extension-cli-compatibility.v1.json +6 -2
  8. package/contracts/runtime-command-surface.v1.json +2 -0
  9. package/contracts/workspace-intelligence/doctor-fix-result.v1.json +11 -1
  10. package/contracts/workspace-intelligence/fact-freshness.v1.json +58 -0
  11. package/contracts/workspace-intelligence/workspace-context.v1.json +84 -1
  12. package/contracts/workspace-intelligence/workspace-intelligence-history.v1.json +6 -2
  13. package/contracts/workspace-intelligence/workspace-model.v1.json +80 -0
  14. package/dist/analyze-UTB3PNKM.js +1 -0
  15. package/dist/artifact-remediation-plan-HRR3WH7T.js +3 -0
  16. package/dist/autopilot-release-MSK4ELKR.js +1 -0
  17. package/dist/chunk-2E6WGUN6.js +1 -0
  18. package/dist/{chunk-RSYUNEH7.js → chunk-42ARJBM7.js} +1 -1
  19. package/dist/{chunk-WCICO7ZB.js → chunk-4RJESJ23.js} +1 -1
  20. package/dist/chunk-56GL3GG7.js +32 -0
  21. package/dist/chunk-7BEZH5LE.js +2 -0
  22. package/dist/{chunk-ZPXMZCYG.js → chunk-ALCH4JAS.js} +1 -1
  23. package/dist/{chunk-ITJ6RKUW.js → chunk-AM5OJWXF.js} +1 -1
  24. package/dist/chunk-COBMOVUK.js +1 -0
  25. package/dist/{chunk-ELU3G6DQ.js → chunk-DKNVDNT4.js} +1 -1
  26. package/dist/{chunk-KIUSCFHF.js → chunk-FI4VMG2I.js} +1 -1
  27. package/dist/chunk-HT3G7HOV.js +78 -0
  28. package/dist/{chunk-BFEBZABL.js → chunk-KZLRUBQ5.js} +19 -19
  29. package/dist/chunk-L3R2AS2W.js +1 -0
  30. package/dist/chunk-LRF6PQOZ.js +1 -0
  31. package/dist/chunk-T5GS4BUP.js +2 -0
  32. package/dist/chunk-TDSIF42O.js +1 -0
  33. package/dist/chunk-THSTNVE3.js +2 -0
  34. package/dist/chunk-ULIVVMT6.js +1 -0
  35. package/dist/chunk-WHQWVQJH.js +4 -0
  36. package/dist/{create-RNP5ACQL.js → create-XTKHAYH7.js} +1 -1
  37. package/dist/doctor-4UQZIELO.js +1 -0
  38. package/dist/index.d.ts +15 -3
  39. package/dist/index.js +165 -140
  40. package/dist/pipeline-UOGPOG7S.js +5 -0
  41. package/dist/{workspace-E554C5SM.js → workspace-VKUBU4M4.js} +1 -1
  42. package/dist/{workspace-agent-sync-BHE2V4KS.js → workspace-agent-sync-RWDOTSWV.js} +1 -1
  43. package/dist/{workspace-context-VJTXW3K4.js → workspace-context-R3XWWLFP.js} +1 -1
  44. package/dist/workspace-explain-JIAM63TE.js +1 -0
  45. package/dist/{workspace-feedback-65NR3EZH.js → workspace-feedback-KCDFF7YS.js} +1 -1
  46. package/dist/{workspace-foundation-LISDH53T.js → workspace-foundation-V6SLZRBY.js} +1 -1
  47. package/dist/workspace-history-DSCH7PQZ.js +1 -0
  48. package/dist/{workspace-intelligence-EC63CRVF.js → workspace-intelligence-5BBKUJAG.js} +1 -1
  49. package/dist/{workspace-marker-IOPQ42A7.js → workspace-marker-HAC7BMEG.js} +1 -1
  50. package/dist/workspace-mcp-serve-GPSSYKZK.js +3 -0
  51. package/dist/workspace-model-YAC5BKLL.js +1 -0
  52. package/dist/workspace-run-MNVPNDUK.js +1 -0
  53. package/dist/{workspace-verify-IAUHP6Y6.js → workspace-verify-YDPCHWGQ.js} +1 -1
  54. package/dist/{workspace-watch-H2AETGFI.js → workspace-watch-P2PGSYDD.js} +1 -1
  55. package/docs/commands-reference.md +1 -0
  56. package/docs/contracts/ARTIFACT_CATALOG.md +70 -20
  57. package/docs/contracts/NAMING_AND_COEXISTENCE.md +3 -2
  58. package/docs/contracts/README.md +2 -0
  59. package/docs/doctor-command.md +217 -13
  60. package/package.json +1 -1
  61. package/scripts/enterprise-package-smoke.mjs +35 -36
  62. package/dist/analyze-QYHMGLSG.js +0 -1
  63. package/dist/autopilot-release-YDEUKRW6.js +0 -1
  64. package/dist/chunk-33LR2QEM.js +0 -2
  65. package/dist/chunk-46AGNYI7.js +0 -50
  66. package/dist/chunk-DWXRVGOY.js +0 -2
  67. package/dist/chunk-EN6YCX36.js +0 -1
  68. package/dist/chunk-HYAT2EG7.js +0 -1
  69. package/dist/chunk-JNXT6KJV.js +0 -32
  70. package/dist/chunk-RV6HBTFC.js +0 -2
  71. package/dist/chunk-VDTAPIHB.js +0 -2
  72. package/dist/chunk-VKLL63TL.js +0 -1
  73. package/dist/chunk-VMJA36WD.js +0 -1
  74. package/dist/doctor-XM6QDTDC.js +0 -1
  75. package/dist/pipeline-YD2DO7XY.js +0 -5
  76. package/dist/workspace-explain-XJ22ZXJY.js +0 -1
  77. package/dist/workspace-history-VPDADQKG.js +0 -1
  78. package/dist/workspace-mcp-serve-KOM2V35Q.js +0 -3
  79. package/dist/workspace-model-YL7W3573.js +0 -1
  80. package/dist/workspace-run-F5FADRY5.js +0 -1
package/README.md CHANGED
@@ -123,6 +123,7 @@ In RapidKit, Workspace Intelligence is not a chat feature. It is the determinist
123
123
  - **Impact** — what changed and which projects, commands, and release gates are affected
124
124
  - **Verify** — which evidence proves the workspace is ready, blocked, or needs attention
125
125
  - **Sync** — how developers, CI, Workspai, and AI agents stay grounded in the same truth
126
+ - **Freshness** — which facts are durable, derived, evidence-backed, live, or must be verified before use
126
127
 
127
128
  ## From Code to Shared Understanding
128
129
 
@@ -162,18 +163,19 @@ For the visual experience, install the [Workspai VS Code extension](https://mark
162
163
 
163
164
  ## Typical workflows
164
165
 
165
- | Question | Command |
166
- | --------------------------------------------- | ---------------------------------------------- |
167
- | What projects exist in this workspace? | `workspace model --json` |
168
- | What context should AI agents receive? | `workspace context --for-agent --json --write` |
169
- | What breaks if I change this? | `workspace impact --from <snapshot>` |
170
- | Why is release blocked? | `workspace explain release-blocked --json --write` |
166
+ | Question | Command |
167
+ | --------------------------------------------- | -------------------------------------------------------------------------------------------- |
168
+ | What projects exist in this workspace? | `workspace model --json` |
169
+ | What context should AI agents receive? | `workspace context --for-agent --json --write` |
170
+ | What breaks if I change this? | `workspace impact --from <snapshot>` |
171
+ | Why is release blocked? | `workspace explain release-blocked --json --write` |
171
172
  | Trace a diff through blast radius and gates? | `workspace trace --from .rapidkit/reports/workspace-model-diff-last-run.json --json --write` |
172
- | Can I safely release? | `pipeline --json --strict` |
173
- | How do I align AI tools and CI? | `workspace agent-sync --write` |
174
- | Expose workspace evidence to MCP clients? | `workspace mcp serve` |
175
- | How do I onboard an existing project? | `adopt` |
176
- | How do I bring repositories into a workspace? | `import` |
173
+ | What should Studio do for blocked artifacts? | `workspace remediation-plan --ci --json --write` |
174
+ | Can I safely release? | `pipeline --json --strict` |
175
+ | How do I align AI tools and CI? | `workspace agent-sync --write` |
176
+ | Expose workspace evidence to MCP clients? | `workspace mcp serve` |
177
+ | How do I onboard an existing project? | `adopt` |
178
+ | How do I bring repositories into a workspace? | `import` |
177
179
 
178
180
  ### Existing project
179
181
 
@@ -307,23 +309,24 @@ assistance, and release decisions backed by evidence instead of guesswork.
307
309
 
308
310
  Workspace Intelligence provides a shared understanding of projects, dependencies, operational context, and release readiness for developers, CI pipelines, and AI agents.
309
311
 
310
- | Command | Purpose |
311
- | ------------------------------------------------- | ------------------------------------------------------------------------------------ |
312
- | `workspace model [--cache\|--incremental] --json` | Canonical workspace model (graph-aware, incremental rebuilds) |
313
- | `workspace context --for-agent --json --write` | Agent-ready context pack + auto agent grounding sync |
314
- | `workspace agent-sync --write` | Agent Customization Pack (AGENTS.md, Copilot, Cursor, Claude, INDEX, skills, agents) |
315
- | `workspace snapshot --json` | Persist model snapshot |
316
- | `workspace diff --from <file\|git[:ref]> --json` | Diff against snapshot or git |
317
- | `workspace impact --from <file> --json` | Graph-aware transitive blast-radius evidence |
318
- | `workspace verify [--strict] --json` | Definitive verification gate (subgraph + freshness + policy + fleet evidence) |
319
- | `workspace explain <target> [--write] --json` | Human narrative for release blockers, projects, or trace slices |
320
- | `workspace why <target>` | Alias of `workspace explain` |
321
- | `workspace trace --from <diff> [--write] --json` | Diff impact → gates narrative for agents and IDE handoff |
322
- | `workspace feedback record --json` | Append structured agent action outcomes to intelligence history |
323
- | `workspace mcp serve` | Read-mostly stdio MCP bridge over workspace evidence |
324
- | `workspace graph <emit\|explain\|dot\|mermaid>` | Inspect and visualize the dependency graph |
325
- | `workspace watch [--json] [--once]` | Daemon mode: keep model + graph in memory, stream change events |
326
- | `workspace run <stage> [--scope project:X] [--reuse-passed]` | Fleet init/test/build/start or custom stages from `.rapidkit/context.json` |
312
+ | Command | Purpose |
313
+ | ------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
314
+ | `workspace model [--cache\|--incremental] --json` | Canonical workspace model (graph-aware, incremental rebuilds) |
315
+ | `workspace context --for-agent --json --write` | Agent-ready context pack + auto agent grounding sync |
316
+ | `workspace agent-sync --write` | Agent Customization Pack (AGENTS.md, Copilot, Cursor, Claude, INDEX, skills, agents) |
317
+ | `workspace snapshot --json` | Persist model snapshot |
318
+ | `workspace diff --from <file\|git[:ref]> --json` | Diff against snapshot or git |
319
+ | `workspace impact --from <file> --json` | Graph-aware transitive blast-radius evidence |
320
+ | `workspace verify [--strict] --json` | Definitive verification gate (subgraph + freshness + policy + fleet evidence) |
321
+ | `workspace remediation-plan [--ci] --json --write` | Cross-artifact Studio repair plan for blocked governance cards |
322
+ | `workspace explain <target> [--write] --json` | Human narrative for release blockers, projects, or trace slices |
323
+ | `workspace why <target>` | Alias of `workspace explain` |
324
+ | `workspace trace --from <diff> [--write] --json` | Diff impact gates narrative for agents and IDE handoff |
325
+ | `workspace feedback record --json` | Append structured agent action outcomes to intelligence history |
326
+ | `workspace mcp serve` | Read-mostly stdio MCP bridge over workspace evidence |
327
+ | `workspace graph <emit\|explain\|dot\|mermaid>` | Inspect and visualize the dependency graph |
328
+ | `workspace watch [--json] [--once]` | Daemon mode: keep model + graph in memory, stream change events |
329
+ | `workspace run <stage> [--scope project:X] [--reuse-passed]` | Fleet init/test/build/start or custom stages from `.rapidkit/context.json` |
327
330
 
328
331
  JSON schemas: `contracts/workspace-intelligence/`. Command coexistence and naming:
329
332
  [docs/contracts/NAMING_AND_COEXISTENCE.md](docs/contracts/NAMING_AND_COEXISTENCE.md).
@@ -364,6 +367,9 @@ radius, gating, and visualization:
364
367
  - **Transitive freshness** — a deterministic `fresh | stale | unknown` verdict chained
365
368
  through the graph: a dependency change makes every dependent stale, not just by
366
369
  timestamp.
370
+ - **Fact freshness contracts** — `workspace model` and agent context packs mark each
371
+ workspace fact as durable, derived, evidence-backed, live, or verify-before-use so
372
+ agents do not reuse stale state as if it were structure.
367
373
  - **Policy violations** — model/contract violations are surfaced as structured
368
374
  `policyViolations[]` (not just an exit code) so IDEs and CI can render blockers.
369
375
  - **Health history** — every verify run appends to a bounded
@@ -401,31 +407,34 @@ npx rapidkit workspace agent-sync --write --strict --json
401
407
  npm run check:agent-customization-drift -- --workspace <workspace-root>
402
408
  ```
403
409
 
404
- | Artifact / file | Purpose |
405
- | ----------------------------------------------------------------------- | -------------------------------------------------------- |
406
- | `.rapidkit/reports/agent-customization-pack.json` | Versioned output inventory, target matrix, drift state |
410
+ | Artifact / file | Purpose |
411
+ | ----------------------------------------------------------------------- | ----------------------------------------------------------- |
412
+ | `.rapidkit/reports/agent-customization-pack.json` | Versioned output inventory, target matrix, drift state |
407
413
  | `.rapidkit/reports/workspace-explain-last-run.json` | Unified explain / trace narrative for blockers and projects |
408
- | `.rapidkit/reports/workspace-skills-index.json` | Index of operational playbooks (`.rapidkit/skills/*.md`) |
409
- | `.rapidkit/skills/rapidkit-*.md` | Operational playbooks (generated by agent-sync) |
410
- | `.rapidkit/reports/rapidkit-mcp-design.json` | Read-mostly MCP-ready tool design manifest |
411
- | `.rapidkit/reports/INDEX.json` | Read order, blockers, report timestamps |
412
- | `.rapidkit/reports/workspace-context-agent.json` | Canonical agent context pack |
413
- | `.rapidkit/AGENT-GROUNDING.md` | Tool-agnostic grounding doc |
414
- | `AGENTS.md` | Open standard for all agents (managed RapidKit section) |
415
- | `.github/copilot-instructions.md` | GitHub Copilot / VS Code Chat always-on rules |
416
- | `.github/instructions/rapidkit-workspace.instructions.md` | Copilot workspace scope and command discipline |
417
- | `.github/instructions/rapidkit-evidence.instructions.md` | Copilot scoped rules for `.rapidkit/**` |
418
- | `.github/prompts/rapidkit-diagnose.prompt.md` | Copilot reusable diagnose prompt |
419
- | `.github/skills/rapidkit-workspace-intelligence/SKILL.md` | Workspace Intelligence skill workflow |
420
- | `.github/skills/rapidkit-workspace-intelligence/resources/mcp-tools.md` | Future MCP tool design reference |
421
- | `.github/agents/workspai-advisor.agent.md` | Read-only workspace advisor agent |
422
- | `.github/agents/workspai-repair.agent.md` | Blocker repair agent |
423
- | `.github/agents/workspai-release.agent.md` | Release safety agent |
424
- | `.github/agents/workspai-project-onboarder.agent.md` | Project onboarding agent |
425
- | `.cursor/rules/rapidkit-grounding.mdc` | Cursor always-on project rule |
426
- | `CLAUDE.md` | Claude Code entry (`@AGENTS.md` + managed notes) |
427
- | `.claude/rules/rapidkit-evidence.md` | Claude Code scoped evidence rules |
428
- | `.vscode/rapidkit-agent-hooks.json` | Optional advisory VS Code hooks (`--experimental-hooks`) |
414
+ | `.rapidkit/reports/workspace-skills-index.json` | Index of operational playbooks (`.rapidkit/skills/*.md`) |
415
+ | `.rapidkit/skills/rapidkit-*.md` | Operational playbooks (generated by agent-sync) |
416
+ | `.rapidkit/reports/rapidkit-mcp-design.json` | Read-mostly MCP-ready tool design manifest |
417
+ | `.rapidkit/reports/INDEX.json` | Read order, blockers, report timestamps |
418
+ | `.rapidkit/reports/workspace-context-agent.json` | Canonical agent context pack |
419
+ | `.rapidkit/reports/artifact-remediation-plan-last-run.json` | Cross-artifact Studio repair plan |
420
+ | `.rapidkit/reports/doctor-remediation-plan-last-run.json` | Doctor-specific ordered repair plan |
421
+ | `.rapidkit/reports/doctor-fix-result-last-run.json` | Doctor fix/apply execution result |
422
+ | `.rapidkit/AGENT-GROUNDING.md` | Tool-agnostic grounding doc |
423
+ | `AGENTS.md` | Open standard for all agents (managed RapidKit section) |
424
+ | `.github/copilot-instructions.md` | GitHub Copilot / VS Code Chat always-on rules |
425
+ | `.github/instructions/rapidkit-workspace.instructions.md` | Copilot workspace scope and command discipline |
426
+ | `.github/instructions/rapidkit-evidence.instructions.md` | Copilot scoped rules for `.rapidkit/**` |
427
+ | `.github/prompts/rapidkit-diagnose.prompt.md` | Copilot reusable diagnose prompt |
428
+ | `.github/skills/rapidkit-workspace-intelligence/SKILL.md` | Workspace Intelligence skill workflow |
429
+ | `.github/skills/rapidkit-workspace-intelligence/resources/mcp-tools.md` | Future MCP tool design reference |
430
+ | `.github/agents/workspai-advisor.agent.md` | Read-only workspace advisor agent |
431
+ | `.github/agents/workspai-repair.agent.md` | Blocker repair agent |
432
+ | `.github/agents/workspai-release.agent.md` | Release safety agent |
433
+ | `.github/agents/workspai-project-onboarder.agent.md` | Project onboarding agent |
434
+ | `.cursor/rules/rapidkit-grounding.mdc` | Cursor always-on project rule |
435
+ | `CLAUDE.md` | Claude Code entry (`@AGENTS.md` + managed notes) |
436
+ | `.claude/rules/rapidkit-evidence.md` | Claude Code scoped evidence rules |
437
+ | `.vscode/rapidkit-agent-hooks.json` | Optional advisory VS Code hooks (`--experimental-hooks`) |
429
438
 
430
439
  The pack also publishes a standard answer contract for agent-facing output:
431
440
 
@@ -115,6 +115,26 @@
115
115
  "label": "Workspace doctor",
116
116
  "required": false
117
117
  },
118
+ {
119
+ "path": ".rapidkit/reports/doctor-project-last-run.json",
120
+ "label": "Project doctor",
121
+ "required": false
122
+ },
123
+ {
124
+ "path": ".rapidkit/reports/doctor-remediation-plan-last-run.json",
125
+ "label": "Doctor remediation plan",
126
+ "required": false
127
+ },
128
+ {
129
+ "path": ".rapidkit/reports/artifact-remediation-plan-last-run.json",
130
+ "label": "Artifact remediation plan",
131
+ "required": false
132
+ },
133
+ {
134
+ "path": ".rapidkit/reports/doctor-fix-result-last-run.json",
135
+ "label": "Doctor fix result",
136
+ "required": false
137
+ },
118
138
  {
119
139
  "path": ".rapidkit/reports/analyze-last-run.json",
120
140
  "label": "Workspace analyze",
@@ -0,0 +1,163 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://rapidkit.dev/contracts/artifact-remediation-plan.v1.json",
4
+ "title": "RapidKit Artifact Remediation Plan",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["schemaVersion", "generatedAt", "workspace", "source", "summary", "actions"],
8
+ "properties": {
9
+ "schemaVersion": {
10
+ "const": "artifact-remediation-plan-v1"
11
+ },
12
+ "generatedAt": {
13
+ "type": "string"
14
+ },
15
+ "workspace": {
16
+ "type": "object",
17
+ "additionalProperties": false,
18
+ "required": ["name"],
19
+ "properties": {
20
+ "name": { "type": "string" },
21
+ "path": { "type": "string" }
22
+ }
23
+ },
24
+ "source": {
25
+ "type": "object",
26
+ "additionalProperties": false,
27
+ "required": ["command", "reportsDir", "includeAbsolutePaths", "ciMode"],
28
+ "properties": {
29
+ "command": { "const": "workspace remediation-plan" },
30
+ "reportsDir": { "type": "string" },
31
+ "includeAbsolutePaths": { "type": "boolean" },
32
+ "ciMode": { "type": "boolean" }
33
+ }
34
+ },
35
+ "summary": {
36
+ "type": "object",
37
+ "additionalProperties": false,
38
+ "required": [
39
+ "artifactsScanned",
40
+ "cardsCovered",
41
+ "totalActions",
42
+ "executableActions",
43
+ "risk"
44
+ ],
45
+ "properties": {
46
+ "artifactsScanned": { "type": "integer", "minimum": 0 },
47
+ "cardsCovered": { "type": "integer", "minimum": 0 },
48
+ "totalActions": { "type": "integer", "minimum": 0 },
49
+ "executableActions": { "type": "integer", "minimum": 0 },
50
+ "risk": { "$ref": "#/$defs/riskSummary" }
51
+ }
52
+ },
53
+ "actions": {
54
+ "type": "array",
55
+ "items": { "$ref": "#/$defs/action" }
56
+ }
57
+ },
58
+ "$defs": {
59
+ "riskSummary": {
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "required": ["safe", "guarded", "invasive"],
63
+ "properties": {
64
+ "safe": { "type": "integer", "minimum": 0 },
65
+ "guarded": { "type": "integer", "minimum": 0 },
66
+ "invasive": { "type": "integer", "minimum": 0 }
67
+ }
68
+ },
69
+ "operation": {
70
+ "oneOf": [
71
+ {
72
+ "type": "object",
73
+ "additionalProperties": false,
74
+ "required": ["type", "path", "content", "overwrite"],
75
+ "properties": {
76
+ "type": { "const": "file-create" },
77
+ "path": { "type": "string" },
78
+ "content": { "type": "string" },
79
+ "overwrite": { "const": false }
80
+ }
81
+ },
82
+ {
83
+ "type": "object",
84
+ "additionalProperties": false,
85
+ "required": ["type", "command", "cwd"],
86
+ "properties": {
87
+ "type": { "const": "run-command" },
88
+ "command": { "type": "string" },
89
+ "cwd": { "enum": ["workspace", "project"] }
90
+ }
91
+ }
92
+ ]
93
+ },
94
+ "action": {
95
+ "type": "object",
96
+ "additionalProperties": false,
97
+ "required": [
98
+ "id",
99
+ "artifactKind",
100
+ "cardId",
101
+ "title",
102
+ "order",
103
+ "phase",
104
+ "scope",
105
+ "status",
106
+ "mode",
107
+ "risk",
108
+ "requiresApproval",
109
+ "blocker",
110
+ "summary",
111
+ "verifyCommand",
112
+ "cwd",
113
+ "files",
114
+ "rollback",
115
+ "notes"
116
+ ],
117
+ "properties": {
118
+ "id": { "type": "string" },
119
+ "artifactKind": { "type": "string" },
120
+ "cardId": { "type": "string" },
121
+ "title": { "type": "string" },
122
+ "order": { "type": "integer", "minimum": 0 },
123
+ "phase": { "type": "string" },
124
+ "scope": { "enum": ["workspace", "project"] },
125
+ "status": { "enum": ["ready", "review-required", "blocked", "guidance-only"] },
126
+ "mode": {
127
+ "enum": [
128
+ "edit-file",
129
+ "run-command",
130
+ "refresh-evidence",
131
+ "verify-before-fix",
132
+ "manual-guidance"
133
+ ]
134
+ },
135
+ "risk": { "enum": ["safe", "guarded", "invasive"] },
136
+ "requiresApproval": { "type": "boolean" },
137
+ "blocker": { "type": "string" },
138
+ "summary": { "type": "string" },
139
+ "command": { "type": "string" },
140
+ "verifyCommand": { "type": "string" },
141
+ "cwd": { "enum": ["workspace", "project"] },
142
+ "files": {
143
+ "type": "array",
144
+ "items": { "type": "string" }
145
+ },
146
+ "operation": { "$ref": "#/$defs/operation" },
147
+ "rollback": {
148
+ "type": "object",
149
+ "additionalProperties": false,
150
+ "required": ["available", "strategy"],
151
+ "properties": {
152
+ "available": { "type": "boolean" },
153
+ "strategy": { "enum": ["idempotent", "manual", "none"] }
154
+ }
155
+ },
156
+ "notes": {
157
+ "type": "array",
158
+ "items": { "type": "string" }
159
+ }
160
+ }
161
+ }
162
+ }
163
+ }
@@ -26,8 +26,22 @@
26
26
  "projectPath": { "type": "string", "minLength": 1 },
27
27
  "projectName": { "type": "string", "minLength": 1 },
28
28
  "healthScore": { "type": "object", "additionalProperties": true },
29
+ "evidenceFreshness": { "$ref": "#/$defs/evidenceFreshness" },
29
30
  "system": { "type": "object", "additionalProperties": true },
30
- "project": { "type": "object", "additionalProperties": true },
31
+ "project": {
32
+ "type": "object",
33
+ "properties": {
34
+ "probes": {
35
+ "type": "array",
36
+ "items": { "$ref": "#/$defs/probe" }
37
+ },
38
+ "repairCapabilities": {
39
+ "type": "array",
40
+ "items": { "$ref": "#/$defs/repairCapability" }
41
+ }
42
+ },
43
+ "additionalProperties": true
44
+ },
31
45
  "summary": {
32
46
  "type": "object",
33
47
  "properties": {
@@ -40,7 +54,251 @@
40
54
  "type": "array",
41
55
  "items": { "type": "object", "additionalProperties": true }
42
56
  },
43
- "contract": { "type": "object", "additionalProperties": true }
57
+ "contract": { "type": "object", "additionalProperties": true },
58
+ "policyProfile": { "$ref": "#/$defs/policyProfile" }
59
+ },
60
+ "$defs": {
61
+ "freshness": {
62
+ "type": "object",
63
+ "required": [
64
+ "category",
65
+ "generatedAt",
66
+ "ttlSeconds",
67
+ "status",
68
+ "verifyBeforeUse",
69
+ "reason"
70
+ ],
71
+ "properties": {
72
+ "category": { "enum": ["structure", "verification", "state"] },
73
+ "generatedAt": { "type": "string", "format": "date-time" },
74
+ "ttlSeconds": { "type": ["integer", "null"], "minimum": 0 },
75
+ "expiresAt": { "type": "string", "format": "date-time" },
76
+ "status": { "enum": ["fresh", "stale", "unknown"] },
77
+ "verifyBeforeUse": { "type": "boolean" },
78
+ "reason": { "type": "string" }
79
+ },
80
+ "additionalProperties": false
81
+ },
82
+ "evidenceFreshness": {
83
+ "type": "object",
84
+ "required": [
85
+ "generatedAt",
86
+ "status",
87
+ "staleProbeCount",
88
+ "unknownProbeCount",
89
+ "liveStateProbeCount",
90
+ "verifyBeforeUseProbeCount"
91
+ ],
92
+ "properties": {
93
+ "generatedAt": { "type": "string", "format": "date-time" },
94
+ "status": { "enum": ["fresh", "stale", "unknown"] },
95
+ "staleProbeCount": { "type": "integer", "minimum": 0 },
96
+ "unknownProbeCount": { "type": "integer", "minimum": 0 },
97
+ "liveStateProbeCount": { "type": "integer", "minimum": 0 },
98
+ "verifyBeforeUseProbeCount": { "type": "integer", "minimum": 0 },
99
+ "oldestProbeGeneratedAt": { "type": "string", "format": "date-time" }
100
+ },
101
+ "additionalProperties": false
102
+ },
103
+ "repairIntent": {
104
+ "type": "object",
105
+ "required": [
106
+ "mode",
107
+ "confidence",
108
+ "primaryActionLabel",
109
+ "requiresApproval",
110
+ "requiresFreshEvidence",
111
+ "reason",
112
+ "relatedCommands"
113
+ ],
114
+ "properties": {
115
+ "mode": {
116
+ "enum": [
117
+ "none",
118
+ "run-command",
119
+ "edit-file",
120
+ "review-required",
121
+ "verify-before-fix",
122
+ "refresh-evidence",
123
+ "manual-guidance"
124
+ ]
125
+ },
126
+ "confidence": { "enum": ["high", "medium", "low"] },
127
+ "primaryActionLabel": { "type": "string" },
128
+ "requiresApproval": { "type": "boolean" },
129
+ "requiresFreshEvidence": { "type": "boolean" },
130
+ "reason": { "type": "string" },
131
+ "relatedCommands": { "type": "array", "items": { "type": "string" } }
132
+ },
133
+ "additionalProperties": false
134
+ },
135
+ "policyProfile": {
136
+ "type": "object",
137
+ "required": [
138
+ "name",
139
+ "exitOnErrors",
140
+ "exitOnWarnings",
141
+ "warningExitCode",
142
+ "advisoryWarningsBlockRelease",
143
+ "description"
144
+ ],
145
+ "properties": {
146
+ "name": { "enum": ["local", "ci", "release", "enterprise-strict"] },
147
+ "exitOnErrors": { "const": true },
148
+ "exitOnWarnings": { "type": "boolean" },
149
+ "warningExitCode": { "enum": [0, 1, 2] },
150
+ "advisoryWarningsBlockRelease": { "type": "boolean" },
151
+ "description": { "type": "string" }
152
+ },
153
+ "additionalProperties": false
154
+ },
155
+ "probe": {
156
+ "type": "object",
157
+ "properties": {
158
+ "id": { "type": "string", "minLength": 1 },
159
+ "label": { "type": "string", "minLength": 1 },
160
+ "status": { "enum": ["pass", "warn", "fail"] },
161
+ "severity": { "enum": ["info", "warn", "error"] },
162
+ "scope": { "type": "string" },
163
+ "reason": { "type": "string" },
164
+ "recommendation": { "type": "string" },
165
+ "freshness": { "$ref": "#/$defs/freshness" },
166
+ "issueClass": {
167
+ "enum": [
168
+ "dependency",
169
+ "environment",
170
+ "security",
171
+ "test",
172
+ "quality",
173
+ "container",
174
+ "deployment",
175
+ "runtime",
176
+ "workspace-contract",
177
+ "source-tree",
178
+ "framework",
179
+ "configuration",
180
+ "custom",
181
+ "unknown"
182
+ ]
183
+ },
184
+ "operationalImpact": {
185
+ "enum": [
186
+ "none",
187
+ "developer-friction",
188
+ "ci-risk",
189
+ "release-risk",
190
+ "security-risk",
191
+ "runtime-risk",
192
+ "customer-risk"
193
+ ]
194
+ },
195
+ "repairIntent": { "$ref": "#/$defs/repairIntent" },
196
+ "repairCapability": { "$ref": "#/$defs/repairCapability" }
197
+ },
198
+ "additionalProperties": true
199
+ },
200
+ "repairCapability": {
201
+ "type": "object",
202
+ "required": [
203
+ "id",
204
+ "issueId",
205
+ "title",
206
+ "status",
207
+ "fixKind",
208
+ "risk",
209
+ "canAutoFix",
210
+ "canEditFiles",
211
+ "requiresApproval",
212
+ "requiresReview",
213
+ "files",
214
+ "refreshCommands",
215
+ "reason"
216
+ ],
217
+ "properties": {
218
+ "id": { "type": "string", "minLength": 1 },
219
+ "issueId": { "type": "string", "minLength": 1 },
220
+ "title": { "type": "string", "minLength": 1 },
221
+ "status": { "enum": ["available", "manual", "blocked"] },
222
+ "fixKind": {
223
+ "enum": [
224
+ "package-json-script",
225
+ "file-create",
226
+ "file-append",
227
+ "file-copy",
228
+ "dependency-sync",
229
+ "command",
230
+ "manual"
231
+ ]
232
+ },
233
+ "risk": { "enum": ["safe", "guarded", "invasive"] },
234
+ "canAutoFix": { "type": "boolean" },
235
+ "canEditFiles": { "type": "boolean" },
236
+ "requiresApproval": { "type": "boolean" },
237
+ "requiresReview": { "type": "boolean" },
238
+ "files": { "type": "array", "items": { "type": "string" } },
239
+ "command": { "type": "string" },
240
+ "operation": { "$ref": "#/$defs/repairOperation" },
241
+ "verifyCommand": { "type": "string" },
242
+ "refreshCommands": { "type": "array", "items": { "type": "string" } },
243
+ "reason": { "type": "string" },
244
+ "limitations": { "type": "array", "items": { "type": "string" } }
245
+ },
246
+ "additionalProperties": true
247
+ },
248
+ "repairOperation": {
249
+ "type": "object",
250
+ "required": ["type", "path"],
251
+ "properties": {
252
+ "type": {
253
+ "enum": [
254
+ "file-create",
255
+ "file-append",
256
+ "file-copy",
257
+ "package-json-script",
258
+ "json-edit",
259
+ "env-key-add",
260
+ "makefile-target"
261
+ ]
262
+ },
263
+ "sourcePath": { "type": "string", "minLength": 1 },
264
+ "path": { "type": "string", "minLength": 1 },
265
+ "content": { "type": "string" },
266
+ "overwrite": { "type": "boolean" },
267
+ "lines": { "type": "array", "items": { "type": "string" } },
268
+ "ensureNewline": { "type": "boolean" },
269
+ "scriptName": { "type": "string" },
270
+ "scriptValue": { "type": "string" },
271
+ "edits": {
272
+ "type": "array",
273
+ "items": {
274
+ "type": "object",
275
+ "required": ["pointer", "value"],
276
+ "properties": {
277
+ "pointer": { "type": "string" },
278
+ "value": { "type": ["string", "number", "boolean", "null"] }
279
+ },
280
+ "additionalProperties": false
281
+ }
282
+ },
283
+ "keys": {
284
+ "type": "array",
285
+ "items": {
286
+ "type": "object",
287
+ "required": ["name", "value"],
288
+ "properties": {
289
+ "name": { "type": "string" },
290
+ "value": { "type": "string" },
291
+ "comment": { "type": "string" }
292
+ },
293
+ "additionalProperties": false
294
+ }
295
+ },
296
+ "target": { "type": "string" },
297
+ "command": { "type": "string" },
298
+ "phony": { "type": "boolean" }
299
+ },
300
+ "additionalProperties": false
301
+ }
44
302
  },
45
303
  "additionalProperties": true
46
304
  }