@pareto4/pp-core 1.11.1 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +31 -0
- package/agents/pp-code-fixer.md +1 -1
- package/agents/pp-debug-session-manager.md +1 -1
- package/agents/pp-debugger.md +1 -1
- package/agents/pp-executor.md +20 -10
- package/agents/pp-intel-updater.md +1 -1
- package/agents/pp-phase-researcher.md +1 -1
- package/agents/pp-plan-checker.md +5 -5
- package/agents/pp-planner.md +10 -24
- package/agents/pp-project-researcher.md +1 -1
- package/agents/pp-research-synthesizer.md +1 -1
- package/agents/pp-ui-researcher.md +1 -1
- package/agents/pp-verifier.md +8 -4
- package/bin/install.js +429 -82
- package/commands/pp-autonomous.md +8 -6
- package/commands/pp-discovery-to-build.md +1 -1
- package/commands/pp-discovery.md +3 -2
- package/commands/pp-discuss-phase.md +2 -2
- package/commands/pp-execute-phase.md +3 -1
- package/commands/pp-graphify.md +5 -5
- package/commands/pp-import.md +1 -1
- package/commands/pp-map-codebase.md +1 -1
- package/commands/pp-ns-project.md +2 -3
- package/commands/pp-ns-workflow.md +1 -1
- package/commands/pp-plan-phase.md +2 -1
- package/commands/pp-verify-work.md +2 -1
- package/gemini-extension.json +1 -1
- package/hooks/dist/pp-cursor-session-start.js +2 -2
- package/hooks/dist/pp-session-state.sh +1 -1
- package/hooks/dist/pp-statusline.js +21 -2
- package/hooks/pp-cursor-session-start.js +2 -2
- package/hooks/pp-session-state.sh +1 -1
- package/hooks/pp-statusline.js +21 -2
- package/package.json +18 -5
- package/pareto-skills/pp-project-setup/SKILL.md +5 -63
- package/pp-core/bin/detect-build-commands.sh +182 -0
- package/pp-core/bin/lib/capability-registry.cjs +65 -7
- package/pp-core/bin/lib/check-command-router.cjs +79 -38
- package/pp-core/bin/lib/clusters.cjs +2 -3
- package/pp-core/bin/lib/command-aliases.cjs +36 -0
- package/pp-core/bin/lib/command-arg-projection.cjs +99 -1
- package/pp-core/bin/lib/commands.cjs +21 -6
- package/pp-core/bin/lib/compose-bindings.cjs +70 -6
- package/pp-core/bin/lib/config-schema.cjs +16 -0
- package/pp-core/bin/lib/config.cjs +142 -27
- package/pp-core/bin/lib/core-utils.cjs +43 -7
- package/pp-core/bin/lib/discovery-input-check.cjs +218 -0
- package/pp-core/bin/lib/discovery-rebaseline.cjs +1372 -0
- package/pp-core/bin/lib/discovery-research-track.cjs +979 -0
- package/pp-core/bin/lib/discovery-rollup.cjs +476 -0
- package/pp-core/bin/lib/discovery-screens.cjs +1995 -0
- package/pp-core/bin/lib/discovery-sweep.cjs +390 -0
- package/pp-core/bin/lib/discovery-table.cjs +98 -0
- package/pp-core/bin/lib/dispatch-plan.cjs +472 -0
- package/pp-core/bin/lib/frontmatter.cjs +17 -2
- package/pp-core/bin/lib/init-command-router.cjs +8 -5
- package/pp-core/bin/lib/init-contract.cjs +93 -4
- package/pp-core/bin/lib/init.cjs +124 -134
- package/pp-core/bin/lib/install-profiles.cjs +5 -0
- package/pp-core/bin/lib/install-run.cjs +536 -0
- package/pp-core/bin/lib/io.cjs +15 -0
- package/pp-core/bin/lib/loop-resolver.cjs +24 -0
- package/pp-core/bin/lib/milestone.cjs +345 -48
- package/pp-core/bin/lib/phase-command-router.cjs +23 -1
- package/pp-core/bin/lib/phase-locator.cjs +15 -6
- package/pp-core/bin/lib/phase-scope.cjs +91 -0
- package/pp-core/bin/lib/phase-tier.cjs +467 -0
- package/pp-core/bin/lib/phase.cjs +247 -21
- package/pp-core/bin/lib/phases-command-router.cjs +2 -0
- package/pp-core/bin/lib/plan-graph.cjs +368 -0
- package/pp-core/bin/lib/planning-workspace.cjs +53 -0
- package/pp-core/bin/lib/platform-bindings.cjs +32 -2
- package/pp-core/bin/lib/profile-output.cjs +11 -3
- package/pp-core/bin/lib/prohibition-enforcement.cjs +112 -0
- package/pp-core/bin/lib/roadmap-parser.cjs +366 -99
- package/pp-core/bin/lib/roadmap.cjs +141 -39
- package/pp-core/bin/lib/runtime-hooks-surface.cjs +1 -1
- package/pp-core/bin/lib/shell-command-projection.cjs +24 -0
- package/pp-core/bin/lib/state-command-router.cjs +82 -13
- package/pp-core/bin/lib/state-document.cjs +124 -7
- package/pp-core/bin/lib/state.cjs +784 -257
- package/pp-core/bin/lib/template.cjs +22 -6
- package/pp-core/bin/lib/vault-command-router.cjs +57 -6
- package/pp-core/bin/lib/vault-practices.cjs +6 -36
- package/pp-core/bin/lib/vault-write-back.cjs +20 -4
- package/pp-core/bin/lib/vault.cjs +555 -23
- package/pp-core/bin/lib/verify.cjs +53 -31
- package/pp-core/bin/lib/workstream.cjs +1 -1
- package/pp-core/bin/lib/worktree-safety.cjs +26 -15
- package/pp-core/bin/portable-timeout.sh +89 -0
- package/pp-core/bin/pp-tools.cjs +149 -9
- package/pp-core/bin/shared/config-defaults.manifest.json +7 -0
- package/pp-core/bin/shared/config-schema.manifest.json +3 -0
- package/pp-core/references/autonomous-best-effort.md +461 -0
- package/pp-core/references/autonomous-lifecycle.md +146 -0
- package/pp-core/references/autonomous-smart-discuss.md +16 -12
- package/pp-core/references/checkpoints.md +1 -1
- package/pp-core/references/discovery-id-conventions.md +202 -0
- package/pp-core/references/discovery-rebaseline.md +254 -0
- package/pp-core/references/discovery-research-track.md +283 -0
- package/pp-core/references/discovery-traceability.md +400 -0
- package/pp-core/references/loop-hook-dispatch.md +7 -0
- package/pp-core/references/mandatory-initial-read.md +1 -1
- package/pp-core/references/planner-gap-closure.md +1 -0
- package/pp-core/references/planner-human-verify-mode.md +1 -1
- package/pp-core/references/planner-load-graph-context.md +1 -1
- package/pp-core/references/planner-plan-graph.md +66 -0
- package/pp-core/references/planner-tdd.md +1 -0
- package/pp-core/references/planning-config.md +8 -0
- package/pp-core/references/sketch-tooling.md +4 -0
- package/pp-core/references/tdd.md +1 -0
- package/pp-core/templates/claude-md.md +1 -1
- package/pp-core/templates/phase-prompt.md +6 -2
- package/pp-core/templates/prototype-review/review.js +303 -0
- package/pp-core/templates/state.md +6 -0
- package/pp-core/workflows/_runtime-launcher.snippet.sh +1 -1
- package/pp-core/workflows/add-backlog.md +1 -1
- package/pp-core/workflows/add-phase.md +1 -1
- package/pp-core/workflows/add-tests.md +1 -1
- package/pp-core/workflows/add-todo.md +1 -1
- package/pp-core/workflows/ai-integration-phase.md +2 -2
- package/pp-core/workflows/audit-fix.md +12 -16
- package/pp-core/workflows/audit-milestone.md +1 -1
- package/pp-core/workflows/audit-uat.md +1 -1
- package/pp-core/workflows/autonomous.md +68 -306
- package/pp-core/workflows/check-todos.md +1 -1
- package/pp-core/workflows/cleanup.md +1 -1
- package/pp-core/workflows/code-review-fix.md +1 -1
- package/pp-core/workflows/code-review.md +19 -7
- package/pp-core/workflows/complete-milestone.md +41 -60
- package/pp-core/workflows/debug.md +1 -1
- package/pp-core/workflows/diagnose-issues.md +1 -1
- package/pp-core/workflows/discovery-sprint/gap-analysis.md +140 -0
- package/pp-core/workflows/discovery-sprint/input-package.md +140 -0
- package/pp-core/workflows/discovery-sprint/prefill.md +92 -0
- package/pp-core/workflows/discovery-sprint/prototype.md +257 -0
- package/pp-core/workflows/discovery-sprint/rebaseline.md +276 -0
- package/pp-core/workflows/discovery-sprint/session-13-gates.md +24 -0
- package/pp-core/workflows/discovery-sprint/sessions/01-kick-off.md +92 -0
- package/pp-core/workflows/discovery-sprint/sessions/02-as-is.md +98 -0
- package/pp-core/workflows/discovery-sprint/sessions/03-to-be.md +215 -0
- package/pp-core/workflows/discovery-sprint/sessions/04-ux-design.md +146 -0
- package/pp-core/workflows/discovery-sprint/sessions/05-architecture.md +98 -0
- package/pp-core/workflows/discovery-sprint/sessions/06-security.md +107 -0
- package/pp-core/workflows/discovery-sprint/sessions/07-identity.md +98 -0
- package/pp-core/workflows/discovery-sprint/sessions/08-integration.md +85 -0
- package/pp-core/workflows/discovery-sprint/sessions/09-qa.md +109 -0
- package/pp-core/workflows/discovery-sprint/sessions/10-infrastructure.md +119 -0
- package/pp-core/workflows/discovery-sprint/sessions/11-roadmap.md +92 -0
- package/pp-core/workflows/discovery-sprint/sessions/12-delivery-model.md +98 -0
- package/pp-core/workflows/discovery-sprint/sessions/13-wrap-up.md +205 -0
- package/pp-core/workflows/discovery-sprint/templates/context-template.md +266 -0
- package/pp-core/workflows/discovery-sprint.md +79 -1714
- package/pp-core/workflows/discovery-to-build/steps/architecture-deliverables.md +5 -5
- package/pp-core/workflows/discovery-to-build/steps/screen-inventory-gate.md +70 -0
- package/pp-core/workflows/discovery-to-build/templates/discovery-references.md +54 -0
- package/pp-core/workflows/discovery-to-build/templates/pp-handoff.md +184 -0
- package/pp-core/workflows/discovery-to-build.md +21 -238
- package/pp-core/workflows/discuss-phase/modes/advisor.md +1 -1
- package/pp-core/workflows/discuss-phase/modes/auto.md +1 -1
- package/pp-core/workflows/discuss-phase/modes/chain.md +1 -1
- package/pp-core/workflows/discuss-phase-assumptions.md +1 -1
- package/pp-core/workflows/discuss-phase.md +9 -2
- package/pp-core/workflows/do.md +4 -4
- package/pp-core/workflows/docs-update.md +1 -1
- package/pp-core/workflows/edit-phase.md +1 -1
- package/pp-core/workflows/eval-review.md +1 -1
- package/pp-core/workflows/execute-phase/steps/checkpoint-handling.md +45 -0
- package/pp-core/workflows/execute-phase/steps/client-context-gate.md +1 -1
- package/pp-core/workflows/execute-phase/steps/codebase-drift-gate.md +1 -1
- package/pp-core/workflows/execute-phase/steps/cross-ai-delegation.md +90 -0
- package/pp-core/workflows/execute-phase/steps/install-run.md +29 -0
- package/pp-core/workflows/execute-phase/steps/phase-close-rebaseline.md +23 -0
- package/pp-core/workflows/execute-phase/steps/post-merge-gate.md +76 -77
- package/pp-core/workflows/execute-phase/steps/serial-group-dispatch.md +72 -0
- package/pp-core/workflows/execute-phase/steps/vault-fetch.md +5 -5
- package/pp-core/workflows/execute-phase/steps/vault-load-gate.md +19 -112
- package/pp-core/workflows/execute-phase.md +102 -216
- package/pp-core/workflows/execute-plan.md +6 -2
- package/pp-core/workflows/explore.md +1 -1
- package/pp-core/workflows/extract-learnings.md +1 -1
- package/pp-core/workflows/forensics.md +4 -4
- package/pp-core/workflows/graduation.md +1 -1
- package/pp-core/workflows/health.md +1 -1
- package/pp-core/workflows/help/modes/brief.md +1 -0
- package/pp-core/workflows/help/modes/default.md +2 -1
- package/pp-core/workflows/help/modes/full.md +12 -5
- package/pp-core/workflows/import.md +1 -1
- package/pp-core/workflows/ingest-docs.md +1 -1
- package/pp-core/workflows/init.md +18 -2
- package/pp-core/workflows/insert-phase.md +1 -1
- package/pp-core/workflows/list-workspaces.md +1 -1
- package/pp-core/workflows/manager.md +3 -3
- package/pp-core/workflows/map-codebase.md +2 -2
- package/pp-core/workflows/milestone-summary.md +4 -4
- package/pp-core/workflows/mvp-phase.md +1 -1
- package/pp-core/workflows/new-milestone.md +7 -8
- package/pp-core/workflows/new-project.md +6 -1
- package/pp-core/workflows/new-workspace.md +1 -1
- package/pp-core/workflows/next.md +2 -2
- package/pp-core/workflows/note.md +2 -2
- package/pp-core/workflows/pause-work.md +1 -1
- package/pp-core/workflows/plan-milestone-gaps.md +1 -1
- package/pp-core/workflows/plan-phase/steps/chunked-planning.md +111 -0
- package/pp-core/workflows/plan-phase/steps/phase-tier.md +34 -0
- package/pp-core/workflows/plan-phase.md +43 -167
- package/pp-core/workflows/plan-review-convergence.md +2 -2
- package/pp-core/workflows/plant-seed.md +1 -1
- package/pp-core/workflows/pr-branch.md +1 -1
- package/pp-core/workflows/profile-user.md +1 -1
- package/pp-core/workflows/progress.md +3 -3
- package/pp-core/workflows/quick.md +3 -1
- package/pp-core/workflows/remove-phase.md +1 -1
- package/pp-core/workflows/remove-workspace.md +1 -1
- package/pp-core/workflows/resume-project.md +6 -12
- package/pp-core/workflows/review.md +1 -1
- package/pp-core/workflows/scan.md +1 -1
- package/pp-core/workflows/secure-phase.md +1 -1
- package/pp-core/workflows/settings-advanced.md +1 -1
- package/pp-core/workflows/settings-integrations.md +1 -1
- package/pp-core/workflows/settings.md +1 -1
- package/pp-core/workflows/ship.md +25 -8
- package/pp-core/workflows/sketch-wrap-up.md +1 -1
- package/pp-core/workflows/sketch.md +2 -1
- package/pp-core/workflows/spec-phase.md +1 -1
- package/pp-core/workflows/spike-wrap-up.md +1 -1
- package/pp-core/workflows/spike.md +1 -1
- package/pp-core/workflows/stats.md +2 -2
- package/pp-core/workflows/thread.md +1 -1
- package/pp-core/workflows/transition.md +5 -9
- package/pp-core/workflows/ui-phase.md +23 -2
- package/pp-core/workflows/ui-review.md +1 -1
- package/pp-core/workflows/ultraplan-phase.md +2 -2
- package/pp-core/workflows/validate-phase.md +1 -1
- package/pp-core/workflows/vault-write-back.md +1 -1
- package/pp-core/workflows/verify-phase.md +29 -26
- package/pp-core/workflows/verify-work.md +14 -10
- package/scripts/base64-scan.sh +7 -41
- package/scripts/changeset/cli.cjs +25 -5
- package/scripts/dev-env.cjs +462 -0
- package/scripts/lib/allowlist-ratchet.cjs +103 -1
- package/scripts/lib/size-budget.cjs +311 -0
- package/scripts/lint-neutrality-names.cjs +694 -0
- package/scripts/lint-org-coordinates.allowlist.json +35 -0
- package/scripts/lint-org-coordinates.cjs +426 -0
- package/scripts/lint-skill-deps.cjs +48 -9
- package/scripts/lint-test-file-count.cjs +17 -2
- package/scripts/prompt-injection-scan.sh +41 -20
- package/scripts/sync-manifest-versions.cjs +41 -7
- package/scripts/sync-runtime-launcher.cjs +106 -1
- package/scripts/update-size-baseline.cjs +274 -30
- package/scripts/workflow-size.cjs +61 -9
- package/commands/pp-build-handoff.md +0 -46
- package/pp-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +0 -94
|
@@ -21,12 +21,12 @@ const { toPosixPath, generateSlugInternal } = coreUtilsMod;
|
|
|
21
21
|
const phaseIdMod = require("./phase-id.cjs");
|
|
22
22
|
const { normalizePhaseName } = phaseIdMod;
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
24
|
-
const
|
|
25
|
-
const {
|
|
24
|
+
const phaseScopeMod = require("./phase-scope.cjs");
|
|
25
|
+
const { resolvePhaseForWrite } = phaseScopeMod;
|
|
26
26
|
const shell_command_projection_cjs_1 = require("./shell-command-projection.cjs");
|
|
27
27
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
28
28
|
const planningWorkspace = require("./planning-workspace.cjs");
|
|
29
|
-
const { planningDir } = planningWorkspace;
|
|
29
|
+
const { planningDir, resolveProjectFile } = planningWorkspace;
|
|
30
30
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
31
31
|
const frontmatter = require("./frontmatter.cjs");
|
|
32
32
|
const { reconstructFrontmatter } = frontmatter;
|
|
@@ -79,8 +79,23 @@ function cmdTemplateFill(cwd, templateType, options, raw) {
|
|
|
79
79
|
if (!options.phase) {
|
|
80
80
|
error('--phase required');
|
|
81
81
|
}
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
// D-02 (todo "template-fill-writes-into-an-archived-
|
|
83
|
+
// phase-directory"): a writer never resolves into a closed milestone's archive. The
|
|
84
|
+
// phase-scope owner hands back a live match only; an archive this phase still names
|
|
85
|
+
// (current milestone, or no longer on the ROADMAP) is refused naming the archive, and a
|
|
86
|
+
// prior milestone's archive whose number the current ROADMAP reuses takes the not-found
|
|
87
|
+
// line below, as the init verbs already answer.
|
|
88
|
+
const verdict = resolvePhaseForWrite(cwd, options.phase);
|
|
89
|
+
if (!verdict.ok && verdict.reason === 'archived') {
|
|
90
|
+
output({ error: 'Phase archived', phase: options.phase, archived: verdict.version, directory: verdict.directory }, raw, undefined);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (!verdict.ok) {
|
|
94
|
+
output({ error: 'Phase not found', phase: options.phase }, raw, undefined);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const phaseInfo = verdict.match;
|
|
98
|
+
if (!phaseInfo.found) {
|
|
84
99
|
output({ error: 'Phase not found', phase: options.phase }, raw, undefined);
|
|
85
100
|
return;
|
|
86
101
|
}
|
|
@@ -156,7 +171,8 @@ function cmdTemplateFill(cwd, templateType, options, raw) {
|
|
|
156
171
|
...fields,
|
|
157
172
|
};
|
|
158
173
|
const planBase = planningDir(cwd);
|
|
159
|
-
|
|
174
|
+
// D1 (261007-jkl): the context reference names the PROJECT.md that answers for this cwd.
|
|
175
|
+
const projectRef = toPosixPath(node_path_1.default.relative(cwd, resolveProjectFile(cwd).path));
|
|
160
176
|
const roadmapRef = toPosixPath(node_path_1.default.relative(cwd, node_path_1.default.join(planBase, 'ROADMAP.md')));
|
|
161
177
|
const stateRef = toPosixPath(node_path_1.default.relative(cwd, node_path_1.default.join(planBase, 'STATE.md')));
|
|
162
178
|
body = [
|
|
@@ -33,6 +33,20 @@ const shell_command_projection_cjs_1 = require("./shell-command-projection.cjs")
|
|
|
33
33
|
const { ERROR_REASON } = io;
|
|
34
34
|
// Default CoreModule implementation. _core seam overrides this for test injection.
|
|
35
35
|
const _defaultCore = { output: io.output };
|
|
36
|
+
/**
|
|
37
|
+
* Pack 6 D-01: the vault router's subcommand table. `readsVerdict` marks every
|
|
38
|
+
* subcommand that reports the vault load verdict — each one must spread the
|
|
39
|
+
* owner's `VAULT_VERDICT_FIELDS` verbatim (tests/vault-status-check.test.cjs
|
|
40
|
+
* enumerates this table and compares every reader against the owner).
|
|
41
|
+
*/
|
|
42
|
+
const VAULT_SUBCOMMANDS = Object.freeze([
|
|
43
|
+
{ name: 'fetch', readsVerdict: false },
|
|
44
|
+
{ name: 'status', readsVerdict: true },
|
|
45
|
+
{ name: 'summary', readsVerdict: false },
|
|
46
|
+
{ name: 'practices', readsVerdict: false },
|
|
47
|
+
{ name: 'org-profile', readsVerdict: false },
|
|
48
|
+
{ name: 'probe', readsVerdict: false },
|
|
49
|
+
]);
|
|
36
50
|
/**
|
|
37
51
|
* Render a short plain-text `vault org-profile` report from its structured
|
|
38
52
|
* shape — one line naming the pointer, one naming the resolution, a
|
|
@@ -93,7 +107,24 @@ function routeVaultCommand({ args, cwd, raw, error, _vault, _core, _practices, _
|
|
|
93
107
|
c.output(vault.vaultFetch(cwd), raw);
|
|
94
108
|
}
|
|
95
109
|
else if (subcommand === 'status') {
|
|
96
|
-
|
|
110
|
+
// Pack 6 D-01: the manifest read is unchanged; the verdict fields come
|
|
111
|
+
// from the one owner, never from a second derivation here.
|
|
112
|
+
const status = vault.vaultStatus(cwd);
|
|
113
|
+
const verdict = vault.computeVaultVerdict && vault.verdictFields ? vault.verdictFields(vault.computeVaultVerdict(cwd)) : {};
|
|
114
|
+
c.output({ ...status, ...verdict }, raw);
|
|
115
|
+
}
|
|
116
|
+
else if (subcommand === 'probe') {
|
|
117
|
+
// Pack 6 D-09: one reachability line, empty when the vault is disabled (D-06).
|
|
118
|
+
const result = vault.vaultProbe ? vault.vaultProbe(cwd) : { line: '', enabled: false };
|
|
119
|
+
if (!result.enabled) {
|
|
120
|
+
c.output(result, true, '');
|
|
121
|
+
}
|
|
122
|
+
else if (raw) {
|
|
123
|
+
c.output(result, true, JSON.stringify(result));
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
c.output(result, true, `${result.line}\n`);
|
|
127
|
+
}
|
|
97
128
|
}
|
|
98
129
|
else if (subcommand === 'summary') {
|
|
99
130
|
c.output(vault.vaultSummary(cwd), raw);
|
|
@@ -257,6 +288,21 @@ function routeVaultCommand({ args, cwd, raw, error, _vault, _core, _practices, _
|
|
|
257
288
|
overridden.push({ key, profile: profileValue, effective: effectiveValue });
|
|
258
289
|
}
|
|
259
290
|
}
|
|
291
|
+
// Pack 6 D-07: the drift comparison above ran on RAW values (two repos
|
|
292
|
+
// differing only by a credential still report drift); what is EMITTED is
|
|
293
|
+
// display-safe — the shared-repo coordinate through the owner, prose
|
|
294
|
+
// through the prose redactor.
|
|
295
|
+
const shownRepo = (key, v) => key === coordinates.SHARED_REPO_CONFIG_KEY && typeof v === 'string' && vault.redactCloneTarget
|
|
296
|
+
? vault.redactCloneTarget(v)
|
|
297
|
+
: v;
|
|
298
|
+
const shownText = (t) => (vault.redactRemoteText ? vault.redactRemoteText(t) : t);
|
|
299
|
+
const shownContributes = {};
|
|
300
|
+
for (const key of Object.keys(resolution.contributes)) {
|
|
301
|
+
shownContributes[key] = shownRepo(key, resolution.contributes[key]) ?? '';
|
|
302
|
+
}
|
|
303
|
+
const shownEffective = {};
|
|
304
|
+
for (const key of Object.keys(effective))
|
|
305
|
+
shownEffective[key] = shownRepo(key, effective[key]);
|
|
260
306
|
const report = {
|
|
261
307
|
pointer: { key: orgProfile.ORG_PROFILE_CONFIG_KEY, value: resolution.configured },
|
|
262
308
|
profile: {
|
|
@@ -266,12 +312,16 @@ function routeVaultCommand({ args, cwd, raw, error, _vault, _core, _practices, _
|
|
|
266
312
|
source: resolution.source,
|
|
267
313
|
dataPath: resolution.dataPath,
|
|
268
314
|
},
|
|
269
|
-
contributes:
|
|
270
|
-
effective,
|
|
271
|
-
overridden
|
|
315
|
+
contributes: shownContributes,
|
|
316
|
+
effective: shownEffective,
|
|
317
|
+
overridden: overridden.map((o) => ({
|
|
318
|
+
key: o.key,
|
|
319
|
+
profile: shownRepo(o.key, o.profile) ?? '',
|
|
320
|
+
effective: shownRepo(o.key, o.effective),
|
|
321
|
+
})),
|
|
272
322
|
ignored: resolution.ignored,
|
|
273
323
|
rejected: resolution.rejected,
|
|
274
|
-
warnings: resolution.warnings,
|
|
324
|
+
warnings: resolution.warnings.map(shownText),
|
|
275
325
|
};
|
|
276
326
|
// Never call error() for a project with no profile, and never exit
|
|
277
327
|
// non-zero for a resolution failure — this is a diagnostic, not an
|
|
@@ -285,9 +335,10 @@ function routeVaultCommand({ args, cwd, raw, error, _vault, _core, _practices, _
|
|
|
285
335
|
}
|
|
286
336
|
}
|
|
287
337
|
else {
|
|
288
|
-
error(
|
|
338
|
+
error(`Unknown vault subcommand. Available: ${VAULT_SUBCOMMANDS.map((x) => x.name).join(', ')}`, ERROR_REASON.SDK_UNKNOWN_COMMAND);
|
|
289
339
|
}
|
|
290
340
|
}
|
|
291
341
|
module.exports = {
|
|
292
342
|
routeVaultCommand,
|
|
343
|
+
VAULT_SUBCOMMANDS,
|
|
293
344
|
};
|
|
@@ -642,42 +642,12 @@ function discoverPracticeFiles(cwd) {
|
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
// ─── Matching + report (PRAC-02 / PRAC-03 / COMM-01) ───────────────────────────
|
|
645
|
-
// External-content fence
|
|
646
|
-
//
|
|
647
|
-
//
|
|
648
|
-
//
|
|
649
|
-
|
|
650
|
-
const EXTERNAL_CONTENT_FENCE_END
|
|
651
|
-
// Zero-width space (U+200B) — invisible when rendered, but breaks an exact
|
|
652
|
-
// string match against the literal fence marker (CR-01 / T-24-05). Used by
|
|
653
|
-
// `defangFenceMarkers` to neutralize a spoofed marker planted inside untrusted
|
|
654
|
-
// body text without visibly mangling the text for a human/agent reader.
|
|
655
|
-
const ZERO_WIDTH_SPACE = '\u200B';
|
|
656
|
-
/**
|
|
657
|
-
* Neutralize any occurrence of the external-content fence marker strings
|
|
658
|
-
* inside untrusted body text BEFORE it is wrapped between the real markers
|
|
659
|
-
* (CR-01 / T-24-05 fence-spoof escape). Without this, a practice body
|
|
660
|
-
* containing the literal end-fence marker (`<!-- vault:external-content-end
|
|
661
|
-
* -->`) could make a downstream consumer that naively splits on the exact
|
|
662
|
-
* marker treat the injected text as being OUTSIDE the untrusted-content
|
|
663
|
-
* fence — the classic "premature fence close" prompt-injection escape.
|
|
664
|
-
*
|
|
665
|
-
* Replaces each literal marker occurrence with a defanged variant (a
|
|
666
|
-
* zero-width space inserted immediately after the opening `<!--`) that is
|
|
667
|
-
* visually indistinguishable but no longer matches the real marker string —
|
|
668
|
-
* so only the two GENUINE markers `boundedFencedExcerpt` appends afterward
|
|
669
|
-
* remain real fence boundaries.
|
|
670
|
-
*/
|
|
671
|
-
function defangFenceMarkers(body) {
|
|
672
|
-
let result = body;
|
|
673
|
-
for (const marker of [EXTERNAL_CONTENT_FENCE_START, EXTERNAL_CONTENT_FENCE_END]) {
|
|
674
|
-
if (result.includes(marker)) {
|
|
675
|
-
const defanged = `${marker.slice(0, 4)}${ZERO_WIDTH_SPACE}${marker.slice(4)}`;
|
|
676
|
-
result = result.split(marker).join(defanged);
|
|
677
|
-
}
|
|
678
|
-
}
|
|
679
|
-
return result;
|
|
680
|
-
}
|
|
645
|
+
// External-content fence (D-15 / T-24-05). Pack 6 D-08: the fence has ONE
|
|
646
|
+
// owner, src/vault.cts — the marker strings and `defangFenceMarkers` are
|
|
647
|
+
// imported from it rather than copied, so every path that hands vault text to
|
|
648
|
+
// an agent defangs every marker spelling (case, whitespace, HTML entities,
|
|
649
|
+
// compatibility forms, zero-width characters), not only the literal marker.
|
|
650
|
+
const { EXTERNAL_CONTENT_FENCE_START, EXTERNAL_CONTENT_FENCE_END, defangFenceMarkers } = vaultMod;
|
|
681
651
|
/**
|
|
682
652
|
* Read a BOUNDED prefix of a practice file's markdown BODY (frontmatter
|
|
683
653
|
* stripped) and wrap it in the `vault:external-content` fence + untrusted-
|
|
@@ -440,7 +440,7 @@ function previewPromotion({ cwd, filePath, _exec, _vault, _practices }) {
|
|
|
440
440
|
cloneDir,
|
|
441
441
|
], { timeout: 120_000 });
|
|
442
442
|
if (cl.exitCode !== 0) {
|
|
443
|
-
const cause =
|
|
443
|
+
const cause = shownCause(cl.stderr);
|
|
444
444
|
return refusal(PROMOTE_GUARD.TRANSPORT, ERROR_REASON.VAULT_PROMOTE_TRANSPORT_FAILED, `This practice was not pushed: git could not reach the vault (${cause}). Check your access to the vault and run the promotion again.`);
|
|
445
445
|
}
|
|
446
446
|
// 3. Capture the baseline BEFORE writing — an id already present in the
|
|
@@ -558,7 +558,7 @@ function previewPromotion({ cwd, filePath, _exec, _vault, _practices }) {
|
|
|
558
558
|
const expect = buildExpectToken(pre.raw, baseline);
|
|
559
559
|
return {
|
|
560
560
|
status: 'preview',
|
|
561
|
-
repo: pre.repo,
|
|
561
|
+
repo: shownRepo(pre.repo),
|
|
562
562
|
ref: pre.ref,
|
|
563
563
|
destination: pre.destination,
|
|
564
564
|
mode,
|
|
@@ -577,9 +577,25 @@ function previewPromotion({ cwd, filePath, _exec, _vault, _practices }) {
|
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
// ─── Confirm (write half of the write path) ──────────────────────────────────────
|
|
580
|
+
/**
|
|
581
|
+
* Pack 6 D-07: the display-safe forms used in every verdict and refusal this
|
|
582
|
+
* module EMITS — the one owner in src/vault.cts, lazily required (the
|
|
583
|
+
* module's `_vault` seam stays the fetch seam; redaction is never mocked).
|
|
584
|
+
* Comparisons, the expect token and every git invocation keep the RAW values.
|
|
585
|
+
*/
|
|
586
|
+
function shownRepo(repo) {
|
|
587
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
588
|
+
const v = require('./vault.cjs');
|
|
589
|
+
return v.redactCloneTarget(repo) ?? repo;
|
|
590
|
+
}
|
|
591
|
+
function shownCause(stderr) {
|
|
592
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
593
|
+
const v = require('./vault.cjs');
|
|
594
|
+
return boundedToken(v.redactRemoteText((stderr || '').split(/\r?\n/)[0] || 'unknown error'));
|
|
595
|
+
}
|
|
580
596
|
/** Build a TRANSPORT refusal from a failed git invocation's stderr (first line only). */
|
|
581
597
|
function transportRefusal(res) {
|
|
582
|
-
const cause =
|
|
598
|
+
const cause = shownCause(res.stderr);
|
|
583
599
|
return refusal(PROMOTE_GUARD.TRANSPORT, ERROR_REASON.VAULT_PROMOTE_TRANSPORT_FAILED, `This practice was not pushed: git could not reach the vault (${cause}). Check your access to the vault and run the promotion again.`);
|
|
584
600
|
}
|
|
585
601
|
/**
|
|
@@ -739,7 +755,7 @@ function confirmPromotion({ cwd, filePath, expect, _exec, _vault, _practices })
|
|
|
739
755
|
}
|
|
740
756
|
return {
|
|
741
757
|
status: 'pushed',
|
|
742
|
-
repo: pre.repo,
|
|
758
|
+
repo: shownRepo(pre.repo),
|
|
743
759
|
ref: pre.ref,
|
|
744
760
|
destination: pre.destination,
|
|
745
761
|
mode,
|