@pareto4/pp-core 1.17.1 → 1.19.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 +5 -3
- package/agents/pp-code-fixer.md +9 -16
- package/agents/pp-code-reviewer.md +2 -78
- package/agents/pp-codebase-mapper.md +3 -0
- package/agents/pp-debugger.md +3 -2
- package/agents/pp-executor.md +25 -30
- package/agents/pp-integration-checker.md +1 -0
- package/agents/pp-phase-researcher.md +3 -1
- package/agents/pp-plan-checker.md +3 -0
- package/agents/pp-planner.md +16 -12
- package/agents/pp-research-synthesizer.md +1 -1
- package/agents/pp-ui-auditor.md +1 -0
- package/agents/pp-ui-researcher.md +3 -1
- package/agents/pp-vault-reviewer.md +43 -189
- package/agents/pp-verifier.md +10 -8
- package/commands/pp-add-tests.md +1 -1
- package/commands/pp-debug.md +1 -0
- package/commands/pp-init.md +4 -3
- package/commands/pp-ns-manage.md +1 -1
- package/commands/pp-ns-review.md +1 -1
- package/commands/pp-quick.md +3 -0
- package/commands/pp-review-backlog.md +2 -1
- package/commands/pp-vault-promote.md +7 -8
- package/commands/pp-vault-review.md +6 -7
- package/gemini-extension.json +1 -1
- package/package.json +3 -6
- package/pp-core/bin/lib/capability-registry.cjs +15 -357
- package/pp-core/bin/lib/capability-state.cjs +15 -79
- package/pp-core/bin/lib/capability-writer.cjs +2 -16
- package/pp-core/bin/lib/check-command-router.cjs +342 -2298
- package/pp-core/bin/lib/clusters.cjs +2 -2
- package/pp-core/bin/lib/commands.cjs +79 -4
- package/pp-core/bin/lib/compose-bindings.cjs +99 -16
- package/pp-core/bin/lib/config.cjs +3 -6
- package/pp-core/bin/lib/discovery-rollup.cjs +9 -6
- package/pp-core/bin/lib/discovery-screens.cjs +20 -2
- package/pp-core/bin/lib/discovery-sweep.cjs +12 -3
- package/pp-core/bin/lib/discovery-vault-check.cjs +37 -3
- package/pp-core/bin/lib/git-base-branch.cjs +10 -13
- package/pp-core/bin/lib/git-provider.cjs +5 -6
- package/pp-core/bin/lib/init-contract.cjs +55 -42
- package/pp-core/bin/lib/init-interactive.cjs +6 -20
- package/pp-core/bin/lib/io.cjs +2 -8
- package/pp-core/bin/lib/loop-resolver.cjs +8 -32
- package/pp-core/bin/lib/org-profile.cjs +16 -92
- package/pp-core/bin/lib/vault-command-router.cjs +174 -1206
- package/pp-core/bin/lib/vault-coordinates.cjs +4 -4
- package/pp-core/bin/lib/vault-index.cjs +44 -74
- package/pp-core/bin/lib/vault-seal.cjs +37 -122
- package/pp-core/bin/lib/vault-standards-promote.cjs +577 -0
- package/pp-core/bin/lib/vault-standards-review.cjs +293 -0
- package/pp-core/bin/lib/vault-standards.cjs +15 -16
- package/pp-core/bin/lib/vault-trace.cjs +40 -3016
- package/pp-core/bin/lib/vault-update.cjs +5 -26
- package/pp-core/bin/lib/vault.cjs +122 -316
- package/pp-core/bin/pp-tools.cjs +15 -36
- package/pp-core/org-profile.json +1 -1
- package/pp-core/references/autonomous-best-effort.md +4 -3
- package/pp-core/references/autonomous-lifecycle.md +1 -0
- package/pp-core/references/autonomous-smart-discuss.md +5 -1
- package/pp-core/references/discovery-id-conventions.md +35 -2
- package/pp-core/references/execute-mvp-tdd.md +3 -3
- package/pp-core/references/git-integration.md +57 -33
- package/pp-core/references/git-planning-commit.md +31 -9
- package/pp-core/references/phase-argument-parsing.md +1 -0
- package/pp-core/references/planner-gap-closure.md +1 -0
- package/pp-core/references/planner-revision.md +3 -1
- package/pp-core/references/planner-tdd.md +4 -4
- package/pp-core/references/planner-vault-standards.md +16 -25
- package/pp-core/references/planning-config.md +3 -3
- package/pp-core/references/shell-portability.md +28 -0
- package/pp-core/references/tdd.md +20 -16
- package/pp-core/references/worktree-path-safety.md +1 -0
- package/pp-core/templates/README.md +1 -1
- package/pp-core/templates/VAULT-REVIEW.md +24 -170
- package/pp-core/templates/milestone.md +5 -5
- package/pp-core/workflows/add-backlog.md +1 -1
- package/pp-core/workflows/add-tests.md +8 -5
- package/pp-core/workflows/add-todo.md +3 -1
- package/pp-core/workflows/ai-integration-phase.md +2 -1
- package/pp-core/workflows/audit-fix.md +7 -6
- package/pp-core/workflows/audit-milestone.md +1 -0
- package/pp-core/workflows/autonomous.md +6 -0
- package/pp-core/workflows/check-todos.md +2 -1
- package/pp-core/workflows/cleanup.md +3 -1
- package/pp-core/workflows/code-review-fix.md +15 -8
- package/pp-core/workflows/code-review.md +16 -58
- package/pp-core/workflows/complete-milestone.md +13 -3
- package/pp-core/workflows/debug.md +4 -2
- package/pp-core/workflows/diagnose-issues.md +1 -1
- package/pp-core/workflows/discovery-sprint/prototype.md +2 -2
- package/pp-core/workflows/discovery-sprint/session-13-gates.md +1 -1
- package/pp-core/workflows/discovery-sprint/sessions/01-kick-off.md +51 -7
- package/pp-core/workflows/discovery-sprint/sessions/02-as-is.md +5 -3
- package/pp-core/workflows/discovery-sprint/sessions/03-to-be.md +10 -8
- package/pp-core/workflows/discovery-sprint/sessions/04-ux-design.md +11 -2
- package/pp-core/workflows/discovery-sprint/sessions/05-architecture.md +5 -5
- package/pp-core/workflows/discovery-sprint/sessions/06-security.md +3 -3
- package/pp-core/workflows/discovery-sprint/sessions/07-identity.md +2 -2
- package/pp-core/workflows/discovery-sprint/sessions/08-integration.md +14 -2
- package/pp-core/workflows/discovery-sprint/sessions/09-qa.md +2 -2
- package/pp-core/workflows/discovery-sprint/sessions/10-infrastructure.md +10 -10
- package/pp-core/workflows/discovery-sprint/sessions/11-roadmap.md +11 -8
- package/pp-core/workflows/discovery-sprint/sessions/12-delivery-model.md +21 -18
- package/pp-core/workflows/discovery-sprint/sessions/13-wrap-up.md +5 -3
- package/pp-core/workflows/discovery-sprint/templates/context-template.md +9 -3
- package/pp-core/workflows/discovery-sprint/vault-context.md +17 -12
- package/pp-core/workflows/discovery-sprint.md +11 -8
- package/pp-core/workflows/discovery-to-build/steps/architecture-deliverables.md +1 -0
- package/pp-core/workflows/discuss-phase-assumptions.md +5 -3
- package/pp-core/workflows/discuss-phase.md +8 -3
- package/pp-core/workflows/docs-update.md +1 -0
- package/pp-core/workflows/eval-review.md +2 -1
- package/pp-core/workflows/execute-phase/steps/check-query-gate.md +13 -14
- package/pp-core/workflows/execute-phase/steps/cross-ai-delegation.md +1 -0
- package/pp-core/workflows/execute-phase/steps/execute-pre-dispatch.md +5 -25
- package/pp-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +1 -0
- package/pp-core/workflows/execute-phase/steps/vault-fetch.md +18 -6
- package/pp-core/workflows/execute-phase/steps/vault-load-gate.md +6 -109
- package/pp-core/workflows/execute-phase/steps/verify-post-gate.md +1 -17
- package/pp-core/workflows/execute-phase.md +21 -12
- package/pp-core/workflows/execute-plan.md +24 -15
- package/pp-core/workflows/explore.md +1 -1
- package/pp-core/workflows/forensics.md +4 -2
- package/pp-core/workflows/health.md +1 -0
- package/pp-core/workflows/help/modes/full.md +1 -1
- package/pp-core/workflows/import.md +2 -1
- package/pp-core/workflows/ingest-docs.md +1 -0
- package/pp-core/workflows/init/steps/client-context-capture.md +1 -0
- package/pp-core/workflows/init/steps/github-provisioning.md +145 -0
- package/pp-core/workflows/init/steps/gitlab-provisioning.md +18 -4
- package/pp-core/workflows/init/steps/reachability-outcome.md +3 -1
- package/pp-core/workflows/init.md +56 -66
- package/pp-core/workflows/map-codebase.md +5 -1
- package/pp-core/workflows/milestone-summary.md +2 -1
- package/pp-core/workflows/mvp-phase.md +1 -0
- package/pp-core/workflows/new-milestone.md +9 -5
- package/pp-core/workflows/new-project.md +9 -8
- package/pp-core/workflows/new-workspace.md +1 -0
- package/pp-core/workflows/next.md +2 -1
- package/pp-core/workflows/pause-work.md +6 -4
- package/pp-core/workflows/plan-milestone-gaps.md +3 -1
- package/pp-core/workflows/plan-phase/steps/chunked-planning.md +1 -1
- package/pp-core/workflows/plan-phase.md +21 -6
- package/pp-core/workflows/plan-review-convergence.md +2 -0
- package/pp-core/workflows/plant-seed.md +4 -2
- package/pp-core/workflows/pr-branch.md +2 -0
- package/pp-core/workflows/progress.md +5 -0
- package/pp-core/workflows/quick.md +19 -12
- package/pp-core/workflows/reapply-patches.md +3 -0
- package/pp-core/workflows/remove-phase.md +1 -1
- package/pp-core/workflows/resume-project.md +3 -0
- package/pp-core/workflows/review.md +7 -1
- package/pp-core/workflows/secure-phase.md +2 -1
- package/pp-core/workflows/session-report.md +1 -0
- package/pp-core/workflows/ship.md +8 -1
- package/pp-core/workflows/sketch-wrap-up.md +1 -1
- package/pp-core/workflows/sketch.md +3 -2
- package/pp-core/workflows/spec-phase.md +2 -1
- package/pp-core/workflows/spike-wrap-up.md +1 -1
- package/pp-core/workflows/spike.md +4 -3
- package/pp-core/workflows/sync-skills.md +5 -2
- package/pp-core/workflows/thread.md +3 -2
- package/pp-core/workflows/transition.md +6 -0
- package/pp-core/workflows/ui-phase.md +3 -1
- package/pp-core/workflows/ui-review.md +2 -1
- package/pp-core/workflows/ultraplan-phase.md +1 -0
- package/pp-core/workflows/undo.md +14 -10
- package/pp-core/workflows/update.md +5 -0
- package/pp-core/workflows/validate-phase.md +9 -6
- package/pp-core/workflows/vault-review.md +65 -186
- package/pp-core/workflows/vault-write-back.md +78 -110
- package/pp-core/workflows/verify-phase.md +5 -0
- package/pp-core/workflows/verify-work.md +9 -2
- package/scripts/gen-capability-registry.cjs +12 -93
- package/scripts/lint-test-file-count.allowlist.json +1 -19
- package/scripts/lint-test-file-count.cjs +5 -6
- package/scripts/prompt-injection-scan.sh +1 -4
- package/scripts/sync-runtime-launcher.cjs +115 -5
- package/pp-core/bin/lib/practices-review-check.cjs +0 -944
- package/pp-core/bin/lib/vault-audit.cjs +0 -2594
- package/pp-core/bin/lib/vault-mode.cjs +0 -235
- package/pp-core/bin/lib/vault-practices.cjs +0 -2057
- package/pp-core/bin/lib/vault-review.cjs +0 -2102
- package/pp-core/bin/lib/vault-write-back.cjs +0 -905
- package/pp-core/references/planner-vault-practices.md +0 -95
- package/pp-core/references/practice-arithmetic-contract.md +0 -121
- package/pp-core/references/verifier-practice-verdicts.md +0 -263
- package/pp-core/templates/practices/README.md +0 -248
- package/pp-core/templates/practices/error-handling.md +0 -18
- package/pp-core/templates/practices/minimal-comments.md +0 -14
- package/pp-core/templates/practices/naming-convention.md +0 -18
- package/pp-core/templates/practices/practice-template.md +0 -23
- package/pp-core/workflows/execute-phase/steps/verifier-practice-payload.md +0 -165
- package/scripts/gen-practice-arithmetic-contract.cjs +0 -412
- package/scripts/practice-arithmetic-contract.allow.json +0 -35
- package/scripts/record-vault-mode-golden.cjs +0 -89
- package/scripts/vault-calibrate.cjs +0 -996
|
@@ -62,52 +62,6 @@ function _isSafePropKey(key) {
|
|
|
62
62
|
return false;
|
|
63
63
|
return true;
|
|
64
64
|
}
|
|
65
|
-
// ─── Vault mode filter (Phase 15 D-02 / D-28) ──────────────────────────────────
|
|
66
|
-
/**
|
|
67
|
-
* Does a hook's declared `vaultMode` filter let it through under the resolved
|
|
68
|
-
* mode? THE ONE statement of the rule (Phase 15 D-02, amended by D-28). Both
|
|
69
|
-
* `resolveLoopHooks` (what renders) and `resolveCapabilityState` (what
|
|
70
|
-
* `capability state` reports) call it, so they cannot drift. It lives here, not
|
|
71
|
-
* in loop-resolver, because loop-resolver already requires this module and the
|
|
72
|
-
* reverse require would be a cycle.
|
|
73
|
-
*
|
|
74
|
-
* - no `vaultMode` on the hook → passes (a hook without the field behaves
|
|
75
|
-
* exactly as before Phase 15);
|
|
76
|
-
* - the input mode is `practices` or `standards` → passes iff the hook's
|
|
77
|
-
* `vaultMode` equals it;
|
|
78
|
-
* - any other input (`null`, absent, an unknown string) is an undefined mode:
|
|
79
|
-
* a filtered GATE passes and a filtered contribution or step drops (D-28).
|
|
80
|
-
* The trace points then still dispatch a gate that fails closed, and no
|
|
81
|
-
* contract renders for a mode nobody defined. The mode is never defaulted
|
|
82
|
-
* to `practices` here.
|
|
83
|
-
*
|
|
84
|
-
* Pure: no I/O, no config read. The mode arrives as a value.
|
|
85
|
-
*/
|
|
86
|
-
function vaultModeFilterVerdict(hookMode, kind, inputMode) {
|
|
87
|
-
if (hookMode === undefined)
|
|
88
|
-
return true;
|
|
89
|
-
const resolved = (inputMode === 'practices' || inputMode === 'standards') ? inputMode : null;
|
|
90
|
-
if (resolved !== null)
|
|
91
|
-
return hookMode === resolved;
|
|
92
|
-
return kind === 'gate';
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Call an injected `resolveVaultMode` (pp-tools builds it on `vaultModeVerdict`)
|
|
96
|
-
* and normalise its answer to `'practices' | 'standards' | null`. A missing
|
|
97
|
-
* resolver, a throw or any other answer is `null`, the undefined mode that
|
|
98
|
-
* `vaultModeFilterVerdict` treats fail-closed (D-28). Shared by both I/O entry
|
|
99
|
-
* points (`cmdLoopRenderHooks`, `cmdCapabilityState`) so the two read the
|
|
100
|
-
* injected mode identically.
|
|
101
|
-
*/
|
|
102
|
-
function resolveInjectedVaultMode(resolveVaultMode) {
|
|
103
|
-
try {
|
|
104
|
-
const m = typeof resolveVaultMode === 'function' ? resolveVaultMode() : null;
|
|
105
|
-
return (m === 'practices' || m === 'standards') ? m : null;
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
return null;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
65
|
// ─── Seal gates over recorded artifacts (Phase 16 D-18 / D-19 / D-26) ──────────
|
|
112
66
|
/**
|
|
113
67
|
* The per-hook seal field's name (Phase 16 D-19). One statement of it: the
|
|
@@ -118,15 +72,13 @@ const SEAL_FIELD = 'onRecordedArtifacts';
|
|
|
118
72
|
/**
|
|
119
73
|
* How the resolver treats one GATE, given its seal field, its capability's
|
|
120
74
|
* state and the injected recorded-artifacts predicate. THE ONE statement of
|
|
121
|
-
* the seal rule (Phase 16 D-19), owned here
|
|
122
|
-
*
|
|
123
|
-
* reverse.
|
|
75
|
+
* the seal rule (Phase 16 D-19), owned here because loop-resolver requires
|
|
76
|
+
* this module, never the reverse.
|
|
124
77
|
*
|
|
125
78
|
* Why a field and not a widened `when` (D-18, measured): the resolver drops a
|
|
126
79
|
* hook whose capability is not `active` BEFORE `when` is read, and `active`
|
|
127
|
-
* ANDs the capability's `activationKey`. With `vault.enabled`
|
|
128
|
-
* `
|
|
129
|
-
* its `when` says. So a seal gate bypasses the active check and the `when`,
|
|
80
|
+
* ANDs the capability's `activationKey`. With `vault.enabled` false no vault
|
|
81
|
+
* hook can render, whatever its `when` says. So a seal gate bypasses the active check and the `when`,
|
|
130
82
|
* under this closed rule only:
|
|
131
83
|
*
|
|
132
84
|
* - no seal field (anything but literal `true`) → `'normal'` when the
|
|
@@ -140,10 +92,7 @@ const SEAL_FIELD = 'onRecordedArtifacts';
|
|
|
140
92
|
* answers literal `true`, else `'drop'`. The predicate is called on this
|
|
141
93
|
* arm ONLY, so no other hook pays its planning-tree read.
|
|
142
94
|
*
|
|
143
|
-
*
|
|
144
|
-
* resolver, so a mode-filtered seal never consults the predicate (research
|
|
145
|
-
* C-1). Seals are declared on vault-practices only (D-26). Pure apart from the
|
|
146
|
-
* injected thunk.
|
|
95
|
+
* Pure apart from the injected thunk.
|
|
147
96
|
*/
|
|
148
97
|
function sealRenderVerdict(sealField, state, recordedArtifacts) {
|
|
149
98
|
const active = state !== undefined && state !== null && state.active === true;
|
|
@@ -216,12 +165,9 @@ function resolveInjectedPlatformBindingsPresent(resolvePlatformBindingsPresent)
|
|
|
216
165
|
* @param input.cwd Optional; when provided, enables raw .planning/config.json
|
|
217
166
|
* fallback reads (levels 2+3 of _resolveActivationValue
|
|
218
167
|
* precedence). Omit for a pure in-memory resolution.
|
|
219
|
-
* @param input.vaultMode Optional resolved vault mode VALUE; a hook carrying
|
|
220
|
-
* `vaultMode` is configured only when
|
|
221
|
-
* `vaultModeFilterVerdict` passes it (Phase 15 D-02/D-28).
|
|
222
168
|
*/
|
|
223
169
|
function resolveCapabilityState(input) {
|
|
224
|
-
const { registry, installedSkills, surfacedSkills, config, cwd
|
|
170
|
+
const { registry, installedSkills, surfacedSkills, config, cwd } = input;
|
|
225
171
|
// Guard: registry missing capabilities
|
|
226
172
|
if (!registry || typeof registry !== 'object' || Array.isArray(registry)) {
|
|
227
173
|
return { capabilities: [] };
|
|
@@ -351,16 +297,17 @@ function resolveCapabilityState(input) {
|
|
|
351
297
|
// (mirrors loop-resolver.isActive: `typeof when !== 'string' || when.length === 0` → false)
|
|
352
298
|
configured = false;
|
|
353
299
|
}
|
|
354
|
-
// Phase 15 D-02/D-28: the mode filter folds into `configured`, through the
|
|
355
|
-
// same rule resolveLoopHooks applies. `vaultMode` is read, never emitted:
|
|
356
|
-
// HookEntry has no such field.
|
|
357
|
-
configured = configured && vaultModeFilterVerdict(h['vaultMode'], kind, vaultMode);
|
|
358
300
|
// Hook active = capability-level active AND hook's own config gate.
|
|
359
301
|
// The capability's `active` constant (= enabled && configActivation) is
|
|
360
302
|
// used here so that a config-disabled capability (active=false) cannot
|
|
361
303
|
// produce active hooks even when the hook's own `when` is unconditional
|
|
362
304
|
// (configured=true). The capability gate cascades to all its hooks.
|
|
363
|
-
|
|
305
|
+
// A seal gate (`SEAL_FIELD`, Phase 16 D-19) never renders for an ACTIVE
|
|
306
|
+
// capability — `sealRenderVerdict` drops it, because the normal gates
|
|
307
|
+
// cover it — so it is reported inactive here, keeping this report in
|
|
308
|
+
// agreement with what `loop render-hooks` renders.
|
|
309
|
+
const seal = kind === 'gate' && h[SEAL_FIELD] === true;
|
|
310
|
+
hooks.push({ point, kind, when: whenRaw, configured, active: active && configured && !seal });
|
|
364
311
|
}
|
|
365
312
|
}
|
|
366
313
|
const stepsRaw = capObj['steps'];
|
|
@@ -519,12 +466,8 @@ function _resolveManifest(commandsGsdDir, configDir) {
|
|
|
519
466
|
* caught by the caller before invoking this function.
|
|
520
467
|
* @param raw Whether to emit raw JSON (io.output raw mode)
|
|
521
468
|
* @param _options Reserved for future use
|
|
522
|
-
* @param resolveOptions `{ vaultMode }`, the resolved vault mode VALUE passed
|
|
523
|
-
* through to resolveCapabilityState (Phase 15 D-02).
|
|
524
|
-
* Omitted by the loop resolver, which reads only the
|
|
525
|
-
* capability-level `active` and filters hooks itself.
|
|
526
469
|
*/
|
|
527
|
-
function resolveCapabilityRuntimeState(cwd, runtimeConfigDir, configOverride
|
|
470
|
+
function resolveCapabilityRuntimeState(cwd, runtimeConfigDir, configOverride) {
|
|
528
471
|
const warnings = [];
|
|
529
472
|
// Resolve runtimeConfigDir using the canonical runtime-homes resolver.
|
|
530
473
|
// When not provided, the active runtime is detected via the canonical
|
|
@@ -630,7 +573,6 @@ function resolveCapabilityRuntimeState(cwd, runtimeConfigDir, configOverride, re
|
|
|
630
573
|
surfacedSkills,
|
|
631
574
|
config,
|
|
632
575
|
cwd,
|
|
633
|
-
vaultMode: resolveOptions.vaultMode,
|
|
634
576
|
});
|
|
635
577
|
return {
|
|
636
578
|
runtimeConfigDir: resolvedConfigDir,
|
|
@@ -638,11 +580,8 @@ function resolveCapabilityRuntimeState(cwd, runtimeConfigDir, configOverride, re
|
|
|
638
580
|
capabilities: result.capabilities,
|
|
639
581
|
};
|
|
640
582
|
}
|
|
641
|
-
function cmdCapabilityState(cwd, runtimeConfigDir, raw,
|
|
642
|
-
|
|
643
|
-
// hook's `active` here agrees with whether it renders.
|
|
644
|
-
const vaultMode = resolveInjectedVaultMode(options['resolveVaultMode']);
|
|
645
|
-
const result = resolveCapabilityRuntimeState(cwd, runtimeConfigDir, undefined, { vaultMode });
|
|
583
|
+
function cmdCapabilityState(cwd, runtimeConfigDir, raw, _options = {}) {
|
|
584
|
+
const result = resolveCapabilityRuntimeState(cwd, runtimeConfigDir);
|
|
646
585
|
for (const warning of result.warnings) {
|
|
647
586
|
coreError(`capability state: ${warning}`);
|
|
648
587
|
}
|
|
@@ -679,9 +618,6 @@ module.exports = {
|
|
|
679
618
|
resolveCapabilityRuntimeState,
|
|
680
619
|
isCapabilityActive,
|
|
681
620
|
cmdCapabilityState,
|
|
682
|
-
// Phase 15 D-02/D-28: the one mode-filter rule (loop-resolver imports it)
|
|
683
|
-
vaultModeFilterVerdict,
|
|
684
|
-
resolveInjectedVaultMode,
|
|
685
621
|
// Phase 16 D-19: the one seal rule, its injected-predicate normaliser and the
|
|
686
622
|
// field name the resolver and the registry generator both read.
|
|
687
623
|
SEAL_FIELD,
|
|
@@ -28,8 +28,6 @@ const { output: coreOutput, error: coreError } = ioMod;
|
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
29
29
|
const capabilityStateMod = require("./capability-state.cjs");
|
|
30
30
|
const { resolveCapabilityRuntimeState, _resolveManifest, _resolveCommandsGsdDir } = capabilityStateMod;
|
|
31
|
-
// On its own line: the line above is baselined verbatim by scripts/verify-rename-guard.cjs.
|
|
32
|
-
const { resolveInjectedVaultMode } = capabilityStateMod;
|
|
33
31
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
34
32
|
const surfaceMod = require("./surface.cjs");
|
|
35
33
|
const { readSurface, writeSurface, applySurface } = surfaceMod;
|
|
@@ -69,15 +67,8 @@ const nodepath = require("path");
|
|
|
69
67
|
function setCapabilityState(cwd, runtimeConfigDir, desired, opts) {
|
|
70
68
|
const warnings = [];
|
|
71
69
|
const errors = [];
|
|
72
|
-
// Phase 15 D-02 / 15-REVIEW WR-07: the mode every hook-level reader uses, so
|
|
73
|
-
// the hooks this command reports and warns about are the hooks that render.
|
|
74
|
-
// 15-REVIEW iter-2 WR-01: the mode is resolved PER READ, never once per
|
|
75
|
-
// command — `vaultModeVerdict` answers "no mode" while `vault.enabled` is off,
|
|
76
|
-
// so a command that itself turns the vault on must re-ask after its write.
|
|
77
70
|
// ── Step 1: Resolve BEFORE state once ────────────────────────────────────
|
|
78
|
-
const before = resolveCapabilityRuntimeState(cwd, runtimeConfigDir
|
|
79
|
-
vaultMode: resolveInjectedVaultMode(opts?.resolveVaultMode),
|
|
80
|
-
});
|
|
71
|
+
const before = resolveCapabilityRuntimeState(cwd, runtimeConfigDir);
|
|
81
72
|
const resolvedConfigDir = before.runtimeConfigDir;
|
|
82
73
|
// ── Load registry ─────────────────────────────────────────────────────────
|
|
83
74
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
@@ -264,11 +255,7 @@ function setCapabilityState(cwd, runtimeConfigDir, desired, opts) {
|
|
|
264
255
|
}
|
|
265
256
|
}
|
|
266
257
|
// ── Step 5: RE-RESOLVE ────────────────────────────────────────────────────
|
|
267
|
-
|
|
268
|
-
// must be judged under the mode `capability state` / render-hooks now see.
|
|
269
|
-
const after = resolveCapabilityRuntimeState(cwd, resolvedConfigDir, undefined, {
|
|
270
|
-
vaultMode: resolveInjectedVaultMode(opts?.resolveVaultMode),
|
|
271
|
-
});
|
|
258
|
+
const after = resolveCapabilityRuntimeState(cwd, resolvedConfigDir);
|
|
272
259
|
// ── Step 6: POST CHECKS ───────────────────────────────────────────────────
|
|
273
260
|
// Check: desired enabled=true but not actually enabled after write
|
|
274
261
|
// (catches the not-in-profile / not-surfaced silent no-op case).
|
|
@@ -328,7 +315,6 @@ function cmdCapabilitySet(cwd, runtimeConfigDir, capId, options, raw) {
|
|
|
328
315
|
];
|
|
329
316
|
const opts = {
|
|
330
317
|
...(options.runtime ? { materialize: { runtime: options.runtime, scope: options.scope ?? 'global' } } : {}),
|
|
331
|
-
resolveVaultMode: options.resolveVaultMode,
|
|
332
318
|
};
|
|
333
319
|
const result = setCapabilityState(cwd, runtimeConfigDir, desired, opts);
|
|
334
320
|
if (raw) {
|