openplanr 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +37 -0
- package/dist/cli/commands/init-deterministic.d.ts.map +1 -1
- package/dist/cli/commands/init-deterministic.js +49 -6
- package/dist/cli/commands/init-deterministic.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts.map +1 -1
- package/dist/cli/commands/upgrade.js +4 -2
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/dashboard/.vite/manifest.json +2 -2
- package/dist/dashboard/assets/{index-Bk8DyO_2.css → index-BU5fzjyz.css} +1 -1
- package/dist/dashboard/assets/index-G7ygVDGg.js +572 -0
- package/dist/dashboard/assets/index-G7ygVDGg.js.map +1 -0
- package/dist/dashboard/dashboard-manifest.json +14 -14
- package/dist/dashboard/index.html +2 -2
- package/dist/models/types.d.ts +0 -46
- package/dist/models/types.d.ts.map +1 -1
- package/dist/services/capability-map-service.d.ts +4 -0
- package/dist/services/capability-map-service.d.ts.map +1 -1
- package/dist/services/capability-map-service.js +7 -1
- package/dist/services/capability-map-service.js.map +1 -1
- package/dist/services/claude-plugin-service.d.ts +15 -1
- package/dist/services/claude-plugin-service.d.ts.map +1 -1
- package/dist/services/claude-plugin-service.js +66 -15
- package/dist/services/claude-plugin-service.js.map +1 -1
- package/dist/services/config-service.d.ts +24 -1
- package/dist/services/config-service.d.ts.map +1 -1
- package/dist/services/config-service.js +69 -2
- package/dist/services/config-service.js.map +1 -1
- package/dist/services/git-service.d.ts +5 -0
- package/dist/services/git-service.d.ts.map +1 -1
- package/dist/services/git-service.js +27 -0
- package/dist/services/git-service.js.map +1 -1
- package/dist/services/linear-pull-service.d.ts.map +1 -1
- package/dist/services/linear-pull-service.js +1 -2
- package/dist/services/linear-pull-service.js.map +1 -1
- package/dist/services/pipeline-package-service.d.ts +2 -0
- package/dist/services/pipeline-package-service.d.ts.map +1 -1
- package/dist/services/pipeline-package-service.js +2 -1
- package/dist/services/pipeline-package-service.js.map +1 -1
- package/dist/services/runtime-change-summary.d.ts.map +1 -1
- package/dist/services/runtime-change-summary.js +4 -0
- package/dist/services/runtime-change-summary.js.map +1 -1
- package/dist/services/runtime-manager-service.d.ts.map +1 -1
- package/dist/services/runtime-manager-service.js +14 -3
- package/dist/services/runtime-manager-service.js.map +1 -1
- package/dist/services/spec-service.d.ts.map +1 -1
- package/dist/services/spec-service.js +11 -22
- package/dist/services/spec-service.js.map +1 -1
- package/dist/services/upgrade-report.d.ts.map +1 -1
- package/dist/services/upgrade-report.js +5 -2
- package/dist/services/upgrade-report.js.map +1 -1
- package/dist/services/upgrade-service.d.ts +14 -0
- package/dist/services/upgrade-service.d.ts.map +1 -1
- package/dist/services/upgrade-service.js +69 -11
- package/dist/services/upgrade-service.js.map +1 -1
- package/dist/templates/rules/shared/capability-map.md.hbs +2 -2
- package/lib/host-packages/adapter-registry.json +5 -5
- package/lib/host-packages/capability-map.json +89 -29
- package/lib/host-packages/claude/.claude-plugin/marketplace.json +2 -2
- package/lib/host-packages/claude/openplanr/.claude-plugin/plugin.json +1 -1
- package/lib/host-packages/claude/openplanr/.openplanr-content.json +70 -38
- package/lib/host-packages/claude/openplanr/CONNECTORS.md +62 -0
- package/lib/host-packages/claude/openplanr/README.md +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-share.mjs +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +146 -54
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +25 -25
- package/lib/host-packages/claude/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +8 -4
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
- package/lib/host-packages/claude/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +8 -4
- package/lib/host-packages/claude/openplanr/skills/connect/SKILL.md +60 -0
- package/lib/host-packages/claude/openplanr/skills/connect/references/connectors.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/openplanr/SKILL.md +4 -0
- package/lib/host-packages/claude/openplanr/skills/plan/SKILL.md +4 -1
- package/lib/host-packages/claude/openplanr/skills/plan/scripts/planning-ids.mjs +49 -3
- package/lib/host-packages/claude/openplanr/skills/share/SKILL.md +87 -0
- package/lib/host-packages/claude/openplanr/skills/share/references/connectors.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/ship/SKILL.md +6 -3
- package/lib/host-packages/claude/openplanr/skills/ship/scripts/discover-verification.mjs +2 -1
- package/lib/host-packages/claude/openplanr/skills/sprint/SKILL.md +15 -6
- package/lib/host-packages/claude/openplanr/skills/sprint/references/connectors.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/sprint/references/tracker-connections.md +9 -13
- package/lib/host-packages/claude/openplanr/skills/status/SKILL.md +14 -3
- package/lib/host-packages/claude/openplanr/skills/status/references/connectors.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/status/references/tracker-connections.md +9 -13
- package/lib/host-packages/claude/openplanr/skills/sync/SKILL.md +25 -10
- package/lib/host-packages/claude/openplanr/skills/sync/references/connectors.md +62 -0
- package/lib/host-packages/claude/openplanr/skills/sync/references/tracker-connections.md +9 -13
- package/lib/host-packages/cursor/openplanr/.openplanr-content.json +69 -37
- package/lib/host-packages/cursor/openplanr/CONNECTORS.md +62 -0
- package/lib/host-packages/cursor/openplanr/manifest.json +4 -2
- package/lib/host-packages/cursor/openplanr/rules/planr-connect/references/connectors.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-connect.mdc +58 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-openplanr.mdc +4 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/planning-ids.mjs +49 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-plan.mdc +4 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-share/references/connectors.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-share.mdc +85 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-ship/scripts/discover-verification.mjs +2 -1
- package/lib/host-packages/cursor/openplanr/rules/planr-ship.mdc +6 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/connectors.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/tracker-connections.md +9 -13
- package/lib/host-packages/cursor/openplanr/rules/planr-sprint.mdc +15 -6
- package/lib/host-packages/cursor/openplanr/rules/planr-status/references/connectors.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-status/references/tracker-connections.md +9 -13
- package/lib/host-packages/cursor/openplanr/rules/planr-status.mdc +14 -3
- package/lib/host-packages/cursor/openplanr/rules/planr-sync/references/connectors.md +62 -0
- package/lib/host-packages/cursor/openplanr/rules/planr-sync/references/tracker-connections.md +9 -13
- package/lib/host-packages/cursor/openplanr/rules/planr-sync.mdc +25 -10
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-share.mjs +1 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +146 -54
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +25 -25
- package/lib/host-packages/cursor/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +8 -4
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
- package/lib/host-packages/cursor/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +8 -4
- package/lib/host-packages/openai/.claude-plugin/marketplace.json +2 -2
- package/lib/host-packages/openai/openplanr/.codex-plugin/plugin.json +1 -1
- package/lib/host-packages/openai/openplanr/.openplanr-content.json +88 -40
- package/lib/host-packages/openai/openplanr/CONNECTORS.md +62 -0
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-share.mjs +1 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/design-shared-protocol-contracts-31a760fc.mjs +259 -36
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/notices/THIRD_PARTY_NOTICES.txt +54 -54
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/lib/artifact/ui/studio-shell.css +1 -1
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources/03-protocol-contracts.js +259 -36
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/artifact/templates/artifact-review-stage.js.sources.json +4 -4
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/package.json +3 -3
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/02-react.js +43 -24
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/03-react-dom-client-fiber-foundations.js +279 -58
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/04-react-dom-client-reconciliation-hooks.js +50 -42
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/05-react-dom-client-render-phases.js +282 -146
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/06-react-dom-client-commit-effects.js +949 -316
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/07-react-dom-client-work-loop-scheduling.js +143 -87
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/08-react-dom-client-dom-events-properties-hydration.js +930 -183
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/09-react-dom-client-public-roots.js +17 -15
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/14-interface-primitives.js +375 -191
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/15-interface-primitives.js +140 -105
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources/16-studio-shell.js +146 -54
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/design/templates/studio/studio.js.sources.json +25 -25
- package/lib/host-packages/openai/openplanr/runtime/design/scripts/runtime/packages/protocol/package.json +8 -4
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/design-protocol-contracts.mjs +259 -36
- package/lib/host-packages/openai/openplanr/runtime/plan/scripts/runtime/packages/protocol/package.json +8 -4
- package/lib/host-packages/openai/openplanr/skills/connect/SKILL.md +59 -0
- package/lib/host-packages/openai/openplanr/skills/connect/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/connect/openplanr.skill.json +37 -0
- package/lib/host-packages/openai/openplanr/skills/connect/references/connectors.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/openplanr/SKILL.md +4 -0
- package/lib/host-packages/openai/openplanr/skills/plan/SKILL.md +4 -1
- package/lib/host-packages/openai/openplanr/skills/plan/scripts/planning-ids.mjs +49 -3
- package/lib/host-packages/openai/openplanr/skills/share/SKILL.md +86 -0
- package/lib/host-packages/openai/openplanr/skills/share/agents/openai.yaml +6 -0
- package/lib/host-packages/openai/openplanr/skills/share/openplanr.skill.json +37 -0
- package/lib/host-packages/openai/openplanr/skills/share/references/connectors.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/ship/SKILL.md +6 -3
- package/lib/host-packages/openai/openplanr/skills/ship/scripts/discover-verification.mjs +2 -1
- package/lib/host-packages/openai/openplanr/skills/sprint/SKILL.md +15 -6
- package/lib/host-packages/openai/openplanr/skills/sprint/openplanr.skill.json +11 -0
- package/lib/host-packages/openai/openplanr/skills/sprint/references/connectors.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/sprint/references/tracker-connections.md +9 -13
- package/lib/host-packages/openai/openplanr/skills/status/SKILL.md +14 -3
- package/lib/host-packages/openai/openplanr/skills/status/openplanr.skill.json +11 -0
- package/lib/host-packages/openai/openplanr/skills/status/references/connectors.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/status/references/tracker-connections.md +9 -13
- package/lib/host-packages/openai/openplanr/skills/sync/SKILL.md +25 -10
- package/lib/host-packages/openai/openplanr/skills/sync/openplanr.skill.json +11 -0
- package/lib/host-packages/openai/openplanr/skills/sync/references/connectors.md +62 -0
- package/lib/host-packages/openai/openplanr/skills/sync/references/tracker-connections.md +9 -13
- package/lib/json-schema.mjs +313 -36
- package/lib/schemas/v1.0.0/spec.schema.json +120 -0
- package/lib/schemas/v1.0.0/story.schema.json +95 -0
- package/lib/schemas/v1.0.0/task.schema.json +171 -0
- package/lib/schemas/v1.7.0/spec.schema.json +117 -0
- package/lib/schemas/v1.7.0/story.schema.json +107 -0
- package/lib/schemas/v1.7.0/task.schema.json +217 -0
- package/package.json +32 -32
- package/dist/dashboard/assets/index-Csby7_ur.js +0 -557
- package/dist/dashboard/assets/index-Csby7_ur.js.map +0 -1
- package/dist/services/audit-log-service.d.ts +0 -47
- package/dist/services/audit-log-service.d.ts.map +0 -1
- package/dist/services/audit-log-service.js +0 -211
- package/dist/services/audit-log-service.js.map +0 -1
- package/dist/services/delta-apply-service.d.ts +0 -16
- package/dist/services/delta-apply-service.d.ts.map +0 -1
- package/dist/services/delta-apply-service.js +0 -74
- package/dist/services/delta-apply-service.js.map +0 -1
- package/dist/services/evidence-verifier.d.ts +0 -71
- package/dist/services/evidence-verifier.d.ts.map +0 -1
- package/dist/services/evidence-verifier.js +0 -174
- package/dist/services/evidence-verifier.js.map +0 -1
- package/dist/services/revise-apply-service.d.ts +0 -55
- package/dist/services/revise-apply-service.d.ts.map +0 -1
- package/dist/services/revise-apply-service.js +0 -265
- package/dist/services/revise-apply-service.js.map +0 -1
- package/dist/services/revise-cache-service.d.ts +0 -46
- package/dist/services/revise-cache-service.d.ts.map +0 -1
- package/dist/services/revise-cache-service.js +0 -89
- package/dist/services/revise-cache-service.js.map +0 -1
- package/dist/services/revise-plan-service.d.ts +0 -38
- package/dist/services/revise-plan-service.d.ts.map +0 -1
- package/dist/services/revise-plan-service.js +0 -153
- package/dist/services/revise-plan-service.js.map +0 -1
- /package/lib/host-packages/claude/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
- /package/lib/host-packages/cursor/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
- /package/lib/host-packages/openai/openplanr/runtime/design/scripts/{design-runtime-support-336900df0d39.mjs → design-runtime-support-e34c388a8e59.mjs} +0 -0
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Revise plan parser.
|
|
3
|
-
*
|
|
4
|
-
* A "plan" is a previously-written revise audit log that we replay to disk
|
|
5
|
-
* without any model calls. This service parses a Markdown audit file
|
|
6
|
-
* emitted by `audit-log-service.ts` back into structured `ReviseAuditEntry`
|
|
7
|
-
* records that the CLI's apply-from-audit path can replay.
|
|
8
|
-
*
|
|
9
|
-
* Parsing is deliberately strict about structure but tolerant of
|
|
10
|
-
* whitespace — audit files are written by us and edited by no-one, so we
|
|
11
|
-
* can rely on the heading hierarchy and section markers. If a user has
|
|
12
|
-
* hand-edited the audit, the parser surfaces specific errors so the user
|
|
13
|
-
* can fix or discard the file rather than silently getting bad replays.
|
|
14
|
-
*
|
|
15
|
-
* Future extension: we may emit a sidecar `.plan.json` next to the
|
|
16
|
-
* Markdown audit to carry content hashes and `revisedMarkdown` without
|
|
17
|
-
* parsing overhead. The Markdown path remains supported indefinitely —
|
|
18
|
-
* older audits predate any sidecar format and still need replay support.
|
|
19
|
-
*/
|
|
20
|
-
import { readFileSync } from 'node:fs';
|
|
21
|
-
/**
|
|
22
|
-
* Parse a revise Markdown audit log into its constituent entries.
|
|
23
|
-
* Throws if the file cannot be read, is empty, or has no entries.
|
|
24
|
-
*/
|
|
25
|
-
export function readPlanFromAudit(auditPath) {
|
|
26
|
-
let raw;
|
|
27
|
-
try {
|
|
28
|
-
raw = readFileSync(auditPath, 'utf-8');
|
|
29
|
-
}
|
|
30
|
-
catch (err) {
|
|
31
|
-
throw new Error(`Cannot read audit file at ${auditPath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
32
|
-
}
|
|
33
|
-
if (raw.length === 0) {
|
|
34
|
-
throw new Error(`Audit file ${auditPath} is empty.`);
|
|
35
|
-
}
|
|
36
|
-
const { scope, startedAt } = parseHeader(raw, auditPath);
|
|
37
|
-
const entries = parseEntries(raw, auditPath);
|
|
38
|
-
if (entries.length === 0) {
|
|
39
|
-
throw new Error(`Audit file ${auditPath} contains no entries — nothing to apply. Re-run revise with --dry-run first.`);
|
|
40
|
-
}
|
|
41
|
-
return { sourcePath: auditPath, scope, startedAt, entries };
|
|
42
|
-
}
|
|
43
|
-
/** Entries that can actually be written on replay (have a diff and target path). */
|
|
44
|
-
export function filterReplayable(plan) {
|
|
45
|
-
return plan.entries.filter((e) => e.outcome === 'would-apply' && e.artifactPath && e.diff && e.diff.length > 0);
|
|
46
|
-
}
|
|
47
|
-
// ---------------------------------------------------------------------------
|
|
48
|
-
// Parsing internals
|
|
49
|
-
// ---------------------------------------------------------------------------
|
|
50
|
-
function parseHeader(raw, auditPath) {
|
|
51
|
-
const title = raw.match(/^#\s+Revise audit\s+—\s+([A-Z]+-\d{3,})\b/m);
|
|
52
|
-
if (!title) {
|
|
53
|
-
throw new Error(`Audit file ${auditPath} does not start with a recognizable header (expected "# Revise audit — <SCOPE>").`);
|
|
54
|
-
}
|
|
55
|
-
const scope = title[1];
|
|
56
|
-
const started = raw.match(/started=([0-9T:\-.Z]+)/);
|
|
57
|
-
return { scope, startedAt: started ? started[1] : undefined };
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Split the audit body into entries by the `### [outcome] ArtifactId` heading.
|
|
61
|
-
* Each entry then parses independently; any entry that fails to parse is
|
|
62
|
-
* collected with a reason in its error field rather than aborting the whole
|
|
63
|
-
* parse — the caller filters to `would-apply` for replay, so skipped/malformed
|
|
64
|
-
* entries simply won't be replayed.
|
|
65
|
-
*/
|
|
66
|
-
function parseEntries(raw, auditPath) {
|
|
67
|
-
// The `## Entries` / `## Summary` headings bookend the body; we scan between them.
|
|
68
|
-
const entriesStart = raw.indexOf('\n## Entries');
|
|
69
|
-
const summaryStart = raw.indexOf('\n## Summary');
|
|
70
|
-
const body = entriesStart >= 0
|
|
71
|
-
? raw.slice(entriesStart, summaryStart >= 0 ? summaryStart : raw.length)
|
|
72
|
-
: raw;
|
|
73
|
-
// Split on the entry heading. Each chunk (except the first, which is the
|
|
74
|
-
// `## Entries` preamble) corresponds to one entry.
|
|
75
|
-
const chunks = body.split(/\n(?=### \[)/);
|
|
76
|
-
const entries = [];
|
|
77
|
-
for (const chunk of chunks) {
|
|
78
|
-
const trimmed = chunk.trim();
|
|
79
|
-
if (!trimmed.startsWith('### ['))
|
|
80
|
-
continue;
|
|
81
|
-
const parsed = parseEntry(trimmed, auditPath);
|
|
82
|
-
if (parsed)
|
|
83
|
-
entries.push(parsed);
|
|
84
|
-
}
|
|
85
|
-
return entries;
|
|
86
|
-
}
|
|
87
|
-
function parseEntry(chunk, _auditPath) {
|
|
88
|
-
const heading = chunk.match(/^### \[([^\]]+)\]\s+(\S+)/);
|
|
89
|
-
if (!heading)
|
|
90
|
-
return null;
|
|
91
|
-
const outcome = heading[1];
|
|
92
|
-
const artifactId = heading[2];
|
|
93
|
-
// Audit files contain native filesystem paths. Capture the complete quoted
|
|
94
|
-
// line so POSIX, Windows drive, UNC, and paths containing spaces all replay.
|
|
95
|
-
const artifactPathMatch = chunk.match(/\n>\s+([^\r\n]+?\.md)\r?(?=\n|$)/);
|
|
96
|
-
const artifactPath = artifactPathMatch ? artifactPathMatch[1] : undefined;
|
|
97
|
-
const timestampMatch = chunk.match(/timestamp=([0-9T:\-.Z]+)/);
|
|
98
|
-
const timestamp = timestampMatch ? timestampMatch[1] : new Date().toISOString();
|
|
99
|
-
const rationaleMatch = chunk.match(/\*\*Rationale:\*\*\s+([\s\S]*?)(?=\n\n\*\*|\n\n```|$)/);
|
|
100
|
-
const rationale = rationaleMatch ? rationaleMatch[1].trim() : '';
|
|
101
|
-
const evidence = parseEvidenceList(chunk);
|
|
102
|
-
const ambiguous = parseAmbiguousList(chunk);
|
|
103
|
-
const diff = parseDiffBlock(chunk);
|
|
104
|
-
return {
|
|
105
|
-
artifactId,
|
|
106
|
-
artifactPath,
|
|
107
|
-
outcome,
|
|
108
|
-
rationale,
|
|
109
|
-
evidence,
|
|
110
|
-
ambiguous,
|
|
111
|
-
diff,
|
|
112
|
-
timestamp,
|
|
113
|
-
// Older audits don't carry these; the replay flow is responsible for
|
|
114
|
-
// computing / verifying them against live content when present.
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function parseEvidenceList(chunk) {
|
|
118
|
-
// Match from `**Evidence:**` heading to the next `**Xxx:**` / `## ` /
|
|
119
|
-
// fenced-diff / end.
|
|
120
|
-
const section = chunk.match(/\*\*Evidence:\*\*\s*\n([\s\S]*?)(?=\n\n\*\*[A-Z]|\n\n```|\n## |$)/);
|
|
121
|
-
if (!section)
|
|
122
|
-
return [];
|
|
123
|
-
const out = [];
|
|
124
|
-
const lineRe = /^-\s+\[([a-z_]+)\]\s+`([^`]+)`(?:\s+—\s+"([\s\S]*?)"\s*$)?/gm;
|
|
125
|
-
let m = lineRe.exec(section[1]);
|
|
126
|
-
while (m !== null) {
|
|
127
|
-
out.push({
|
|
128
|
-
type: m[1],
|
|
129
|
-
ref: m[2],
|
|
130
|
-
quote: m[3],
|
|
131
|
-
});
|
|
132
|
-
m = lineRe.exec(section[1]);
|
|
133
|
-
}
|
|
134
|
-
return out;
|
|
135
|
-
}
|
|
136
|
-
function parseAmbiguousList(chunk) {
|
|
137
|
-
const section = chunk.match(/\*\*Ambiguous[^*]*\*\*\s*\n([\s\S]*?)(?=\n\n\*\*[A-Z]|\n\n```|\n## |$)/);
|
|
138
|
-
if (!section)
|
|
139
|
-
return [];
|
|
140
|
-
const out = [];
|
|
141
|
-
const lineRe = /^-\s+§([^:]+):\s+(.+)$/gm;
|
|
142
|
-
let m = lineRe.exec(section[1]);
|
|
143
|
-
while (m !== null) {
|
|
144
|
-
out.push({ section: m[1].trim(), reason: m[2].trim() });
|
|
145
|
-
m = lineRe.exec(section[1]);
|
|
146
|
-
}
|
|
147
|
-
return out;
|
|
148
|
-
}
|
|
149
|
-
function parseDiffBlock(chunk) {
|
|
150
|
-
const m = chunk.match(/\*\*Diff:\*\*\s*\n```diff\n([\s\S]*?)\n```/);
|
|
151
|
-
return m ? m[1] : undefined;
|
|
152
|
-
}
|
|
153
|
-
//# sourceMappingURL=revise-plan-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"revise-plan-service.js","sourceRoot":"","sources":["../../src/services/revise-plan-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAmBvC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,6BAA6B,SAAS,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAC9F,CAAC;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