@deftai/directive-core 0.104.0 → 0.106.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/dist/authz/classify.js +1108 -67
- package/dist/check/cached-orchestrator.d.ts +1 -1
- package/dist/check/cached-orchestrator.js +2 -2
- package/dist/check/named-cause.d.ts +1 -1
- package/dist/check/named-cause.js +34 -4
- package/dist/codebase/default-extractor.d.ts +5 -0
- package/dist/codebase/default-extractor.js +7 -15
- package/dist/deposit/copy-tree.js +60 -0
- package/dist/deposit/python-free.js +26 -18
- package/dist/doctor/checks.d.ts +8 -0
- package/dist/doctor/checks.js +37 -25
- package/dist/doctor/doctor-state.d.ts +4 -0
- package/dist/doctor/doctor-state.js +7 -1
- package/dist/doctor/main.js +9 -19
- package/dist/doctor/types.d.ts +9 -0
- package/dist/forward-coverage/diff-coverage.d.ts +39 -0
- package/dist/forward-coverage/diff-coverage.js +112 -0
- package/dist/forward-coverage/diff-lines.d.ts +19 -0
- package/dist/forward-coverage/diff-lines.js +173 -0
- package/dist/forward-coverage/evaluate.d.ts +24 -9
- package/dist/forward-coverage/evaluate.js +125 -19
- package/dist/fs/contained-write.d.ts +115 -1
- package/dist/fs/contained-write.js +241 -5
- package/dist/fs/mutation-ledger.d.ts +54 -0
- package/dist/fs/mutation-ledger.js +133 -0
- package/dist/fs/non-product-dirs.d.ts +79 -0
- package/dist/fs/non-product-dirs.js +96 -0
- package/dist/hooks/dispatcher.d.ts +3 -1
- package/dist/hooks/dispatcher.js +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/init-deposit/agent-hooks.d.ts +1 -1
- package/dist/init-deposit/agent-hooks.js +18 -16
- package/dist/init-deposit/core-guard-pin-content.d.ts +7 -0
- package/dist/init-deposit/core-guard-pin-content.js +393 -0
- package/dist/init-deposit/gitignore.js +9 -0
- package/dist/init-deposit/hygiene.d.ts +47 -11
- package/dist/init-deposit/hygiene.js +172 -37
- package/dist/init-deposit/legacy-detect.js +6 -2
- package/dist/init-deposit/refresh.d.ts +21 -1
- package/dist/init-deposit/refresh.js +106 -9
- package/dist/init-deposit/scaffold.js +28 -279
- package/dist/init-deposit/slash-deposit.js +13 -7
- package/dist/init-deposit/xbrief-projections.d.ts +8 -1
- package/dist/init-deposit/xbrief-projections.js +24 -11
- package/dist/intake/clause-derivation.d.ts +47 -1
- package/dist/intake/clause-derivation.js +238 -9
- package/dist/intake/issue-ingest.d.ts +3 -1
- package/dist/intake/issue-ingest.js +35 -6
- package/dist/lifecycle/completed-tracked-on-delivery.d.ts +5 -0
- package/dist/lifecycle/completed-tracked-on-delivery.js +85 -18
- package/dist/lifecycle-visible/evaluate.d.ts +98 -0
- package/dist/lifecycle-visible/evaluate.js +710 -0
- package/dist/lifecycle-visible/index.d.ts +2 -0
- package/dist/lifecycle-visible/index.js +2 -0
- package/dist/literal-acceptance/capture.d.ts +10 -0
- package/dist/literal-acceptance/capture.js +226 -77
- package/dist/literal-acceptance/evaluate.d.ts +29 -4
- package/dist/literal-acceptance/evaluate.js +70 -2
- package/dist/literal-acceptance/index.d.ts +3 -3
- package/dist/literal-acceptance/index.js +3 -3
- package/dist/literal-acceptance/safety.d.ts +41 -0
- package/dist/literal-acceptance/safety.js +126 -2
- package/dist/literal-acceptance/types.d.ts +8 -0
- package/dist/orchestration/judgment-policy.d.ts +13 -0
- package/dist/orchestration/judgment-policy.js +15 -0
- package/dist/orchestration/probe-session.js +13 -8
- package/dist/orchestration/verify-judgment-gates.d.ts +4 -0
- package/dist/orchestration/verify-judgment-gates.js +43 -11
- package/dist/orphan-active/evaluate.d.ts +7 -1
- package/dist/orphan-active/evaluate.js +102 -23
- package/dist/platform/platform-capabilities.js +2 -3
- package/dist/policy/base-branch.d.ts +37 -0
- package/dist/policy/base-branch.js +114 -0
- package/dist/policy/branch-sync.d.ts +80 -0
- package/dist/policy/branch-sync.js +211 -0
- package/dist/policy/ceremony-dial-escalation.js +1 -0
- package/dist/policy/ceremony-dial.js +11 -21
- package/dist/policy/delivery-branch.d.ts +5 -3
- package/dist/policy/delivery-branch.js +7 -3
- package/dist/policy/file-size-thresholds.d.ts +24 -0
- package/dist/policy/file-size-thresholds.js +23 -0
- package/dist/policy/forge-outage-retry.d.ts +47 -0
- package/dist/policy/forge-outage-retry.js +157 -0
- package/dist/policy/host-hooks.d.ts +20 -0
- package/dist/policy/host-hooks.js +121 -2
- package/dist/policy/index.d.ts +7 -0
- package/dist/policy/index.js +66 -7
- package/dist/policy/org-force-on-migration.js +2 -1
- package/dist/policy/plan-extensions.d.ts +1 -1
- package/dist/policy/plan-extensions.js +2 -0
- package/dist/policy/product-signal.js +6 -7
- package/dist/policy/project-invariants.d.ts +50 -0
- package/dist/policy/project-invariants.js +205 -0
- package/dist/policy/require-human-merge.js +8 -6
- package/dist/policy/resolve.d.ts +7 -2
- package/dist/policy/resolve.js +25 -8
- package/dist/policy/sync-default.d.ts +129 -0
- package/dist/policy/sync-default.js +452 -0
- package/dist/policy/sync-max-files.d.ts +93 -0
- package/dist/policy/sync-max-files.js +192 -0
- package/dist/policy/value-feedback.js +7 -8
- package/dist/pr-monitor/absent-required.d.ts +11 -0
- package/dist/pr-monitor/absent-required.js +61 -0
- package/dist/pr-monitor/constants.d.ts +7 -0
- package/dist/pr-monitor/constants.js +7 -0
- package/dist/pr-monitor/index.d.ts +2 -1
- package/dist/pr-monitor/index.js +2 -1
- package/dist/pr-monitor/main.js +4 -0
- package/dist/pr-monitor/monitor.js +24 -1
- package/dist/pr-wait-mergeable/classify.js +6 -0
- package/dist/preflight/evaluate.d.ts +4 -0
- package/dist/preflight/evaluate.js +35 -1
- package/dist/preflight/index.d.ts +4 -0
- package/dist/preflight/index.js +2 -0
- package/dist/preflight/intended-placement.d.ts +62 -0
- package/dist/preflight/intended-placement.js +275 -0
- package/dist/preflight/project-invariants-gate.d.ts +29 -0
- package/dist/preflight/project-invariants-gate.js +82 -0
- package/dist/preflight-cache/evaluate.d.ts +12 -0
- package/dist/preflight-cache/evaluate.js +15 -1
- package/dist/preflight-cache/index.d.ts +1 -1
- package/dist/preflight-cache/index.js +1 -1
- package/dist/product-first-done-gate/acceptance-resolver.d.ts +128 -0
- package/dist/product-first-done-gate/acceptance-resolver.js +144 -0
- package/dist/product-first-done-gate/acceptance.d.ts +7 -4
- package/dist/product-first-done-gate/acceptance.js +79 -8
- package/dist/product-first-done-gate/empty-resolution.d.ts +4 -1
- package/dist/product-first-done-gate/empty-resolution.js +12 -1
- package/dist/product-first-done-gate/evaluate.d.ts +16 -0
- package/dist/product-first-done-gate/evaluate.js +298 -34
- package/dist/product-first-done-gate/index.d.ts +2 -0
- package/dist/product-first-done-gate/index.js +1 -0
- package/dist/release/build-dist.d.ts +101 -0
- package/dist/release/build-dist.js +428 -46
- package/dist/release/closed-verb-gate.d.ts +12 -0
- package/dist/release/closed-verb-gate.js +51 -0
- package/dist/release/index.d.ts +1 -0
- package/dist/release/index.js +1 -0
- package/dist/release/pipeline.js +7 -0
- package/dist/release/types.d.ts +12 -0
- package/dist/render/constants.d.ts +2 -1
- package/dist/render/constants.js +2 -1
- package/dist/render/framework-commands.js +4 -0
- package/dist/render/spec-validate.js +23 -12
- package/dist/run-summary/emit.d.ts +16 -10
- package/dist/run-summary/emit.js +26 -15
- package/dist/run-summary/index.d.ts +3 -2
- package/dist/run-summary/index.js +2 -1
- package/dist/run-summary/session-id.d.ts +21 -0
- package/dist/run-summary/session-id.js +92 -0
- package/dist/run-summary/types.d.ts +33 -4
- package/dist/run-summary/types.js +1 -0
- package/dist/scope/acceptance-evidence.d.ts +19 -7
- package/dist/scope/acceptance-evidence.js +38 -11
- package/dist/scope/delivery-evidence.d.ts +3 -3
- package/dist/scope/delivery-evidence.js +22 -27
- package/dist/scope/index.d.ts +1 -0
- package/dist/scope/index.js +1 -0
- package/dist/scope/main.js +15 -5
- package/dist/scope/parent-lineage.js +7 -6
- package/dist/scope/project-invariant-coverage.d.ts +54 -0
- package/dist/scope/project-invariant-coverage.js +322 -0
- package/dist/scope/promote-from-issue.js +5 -5
- package/dist/scope/transition.js +1 -1
- package/dist/scope-provenance/compare-intent.d.ts +27 -0
- package/dist/scope-provenance/compare-intent.js +233 -0
- package/dist/scope-provenance/digest.d.ts +18 -1
- package/dist/scope-provenance/digest.js +16 -11
- package/dist/scope-provenance/evaluate.d.ts +5 -1
- package/dist/scope-provenance/evaluate.js +67 -7
- package/dist/scope-provenance/extract-intent.d.ts +43 -0
- package/dist/scope-provenance/extract-intent.js +262 -0
- package/dist/scope-provenance/index.d.ts +7 -1
- package/dist/scope-provenance/index.js +7 -1
- package/dist/scope-provenance/intent-digest.d.ts +12 -0
- package/dist/scope-provenance/intent-digest.js +33 -0
- package/dist/scope-provenance/intent-evaluate.d.ts +43 -0
- package/dist/scope-provenance/intent-evaluate.js +149 -0
- package/dist/scope-provenance/json-tokenizer.d.ts +19 -0
- package/dist/scope-provenance/json-tokenizer.js +225 -0
- package/dist/scope-provenance/known-machine.d.ts +38 -0
- package/dist/scope-provenance/known-machine.js +157 -0
- package/dist/scope-provenance/mint-artifacts.d.ts +102 -0
- package/dist/scope-provenance/mint-artifacts.js +425 -0
- package/dist/session/ac-pass-banking.d.ts +9 -36
- package/dist/session/ac-pass-banking.js +33 -79
- package/dist/session/ac-pass-reuse.d.ts +53 -0
- package/dist/session/ac-pass-reuse.js +95 -0
- package/dist/session/git.js +19 -4
- package/dist/session/index.d.ts +4 -0
- package/dist/session/index.js +4 -0
- package/dist/session/occupancy-stress-worker.d.ts +7 -0
- package/dist/session/occupancy-stress-worker.js +36 -0
- package/dist/session/occupancy.d.ts +97 -0
- package/dist/session/occupancy.js +422 -0
- package/dist/session/openclaw-soft-rebind-deposit.js +6 -6
- package/dist/session/process-cost.d.ts +32 -10
- package/dist/session/process-cost.js +189 -1
- package/dist/session/product-state-hash.d.ts +26 -0
- package/dist/session/product-state-hash.js +700 -0
- package/dist/session/ritual-entrypoint.js +16 -1
- package/dist/session/session-ready.d.ts +2 -0
- package/dist/session/session-ready.js +52 -30
- package/dist/session/session-start.d.ts +13 -0
- package/dist/session/session-start.js +103 -9
- package/dist/session/verify-ac-session-cache.d.ts +42 -0
- package/dist/session/verify-ac-session-cache.js +126 -0
- package/dist/session/verify-session-ritual.d.ts +28 -0
- package/dist/session/verify-session-ritual.js +97 -5
- package/dist/slash/openclaw-deposit.js +13 -9
- package/dist/slice/constants.d.ts +2 -2
- package/dist/slice/constants.js +2 -2
- package/dist/slice/existing.js +9 -3
- package/dist/slice/lock.d.ts +16 -1
- package/dist/slice/lock.js +137 -11
- package/dist/story-ready/evaluate.d.ts +2 -0
- package/dist/story-ready/evaluate.js +13 -0
- package/dist/swarm/complete-cohort.d.ts +3 -0
- package/dist/swarm/complete-cohort.js +59 -11
- package/dist/swarm/finalize-cohort-cli.d.ts +7 -2
- package/dist/swarm/finalize-cohort-cli.js +165 -35
- package/dist/swarm/finalize-cohort.d.ts +1 -0
- package/dist/swarm/finalize-cohort.js +47 -4
- package/dist/swarm/launch.d.ts +22 -0
- package/dist/swarm/launch.js +155 -0
- package/dist/swarm/routing-set-cli.d.ts +11 -1
- package/dist/swarm/routing-set-cli.js +15 -3
- package/dist/swarm/routing-verify.d.ts +13 -1
- package/dist/swarm/routing-verify.js +60 -21
- package/dist/swarm/routing.d.ts +14 -0
- package/dist/swarm/routing.js +53 -3
- package/dist/telemetry-coverage/fake-trial.js +10 -0
- package/dist/telemetry-coverage/kinds.js +2 -0
- package/dist/triage/actions/index.js +4 -1
- package/dist/triage/bootstrap/index.js +6 -6
- package/dist/triage/help/registry-data.d.ts +1 -1
- package/dist/triage/help/registry-data.js +1 -1
- package/dist/triage/welcome/writers.d.ts +1 -1
- package/dist/triage/welcome/writers.js +10 -5
- package/dist/ts-check-lane/index.d.ts +3 -0
- package/dist/ts-check-lane/index.js +2 -0
- package/dist/ts-check-lane/progress-reporter.d.ts +17 -0
- package/dist/ts-check-lane/progress-reporter.js +38 -0
- package/dist/ts-check-lane/progress.d.ts +32 -0
- package/dist/ts-check-lane/progress.js +57 -0
- package/dist/ts-check-lane/run-lane.d.ts +3 -1
- package/dist/ts-check-lane/run-lane.js +8 -6
- package/dist/validate-content/validate-links.d.ts +8 -0
- package/dist/validate-content/validate-links.js +9 -15
- package/dist/value/feedback-file.js +12 -2
- package/dist/value/readback.d.ts +4 -1
- package/dist/value/readback.js +51 -12
- package/dist/vbrief-build/index.d.ts +1 -0
- package/dist/vbrief-build/index.js +1 -0
- package/dist/vbrief-build/project-invariants-io.d.ts +16 -0
- package/dist/vbrief-build/project-invariants-io.js +41 -0
- package/dist/vbrief-reconcile/graph.js +18 -1
- package/dist/vbrief-reconcile/index.d.ts +1 -1
- package/dist/vbrief-reconcile/index.js +1 -1
- package/dist/vbrief-reconcile/types.d.ts +13 -0
- package/dist/vbrief-reconcile/umbrellas.d.ts +14 -0
- package/dist/vbrief-reconcile/umbrellas.js +261 -26
- package/dist/vbrief-validate/index.d.ts +1 -1
- package/dist/vbrief-validate/index.js +1 -1
- package/dist/vbrief-validate/plan-hooks.d.ts +4 -0
- package/dist/vbrief-validate/plan-hooks.js +68 -0
- package/dist/vbrief-validate/schema.d.ts +4 -0
- package/dist/vbrief-validate/schema.js +1 -1
- package/dist/verify-ac/evaluate.d.ts +7 -1
- package/dist/verify-ac/evaluate.js +34 -26
- package/dist/verify-ac/flag.d.ts +4 -0
- package/dist/verify-ac/flag.js +16 -0
- package/dist/verify-ac/index.d.ts +2 -2
- package/dist/verify-ac/index.js +2 -2
- package/dist/verify-env/agent-hook-readiness.d.ts +2 -2
- package/dist/verify-env/agent-hook-readiness.js +12 -8
- package/dist/verify-env/agent-hooks-live-probe.d.ts +5 -1
- package/dist/verify-env/agent-hooks-live-probe.js +26 -5
- package/dist/verify-env/agent-hooks.js +3 -4
- package/dist/verify-source/contained-writes.js +2 -0
- package/dist/verify-source/verify-stubs.d.ts +15 -1
- package/dist/verify-source/verify-stubs.js +20 -16
- package/dist/vitest-runner/win32-coverage-tmp-setup.d.ts +5 -6
- package/dist/vitest-runner/win32-coverage-tmp-setup.js +5 -6
- package/dist/xbrief-migrate/migrate-project.js +2 -5
- package/package.json +7 -3
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed plan.policy.forgeOutageRetryMinutes (#3422).
|
|
3
|
+
*
|
|
4
|
+
* Re-probe interval after a forge / SCM API outage drop-back.
|
|
5
|
+
* Precedence: USER.md Personal > project policy > framework default 30.
|
|
6
|
+
* Integer minutes, minimum 5.
|
|
7
|
+
*/
|
|
8
|
+
export declare const FIELD_FORGE_OUTAGE_RETRY_MINUTES = "plan.policy.forgeOutageRetryMinutes";
|
|
9
|
+
export declare const FIELD_FORGE_OUTAGE_RETRY_MINUTES_CLI_ALIAS = "forgeOutageRetryMinutes";
|
|
10
|
+
export declare const DEFAULT_FORGE_OUTAGE_RETRY_MINUTES = 30;
|
|
11
|
+
export declare const MIN_FORGE_OUTAGE_RETRY_MINUTES = 5;
|
|
12
|
+
export type ForgeOutageRetrySource = "user-md" | "typed" | "default" | "default-on-error";
|
|
13
|
+
export interface ForgeOutageRetryResolved {
|
|
14
|
+
readonly minutes: number;
|
|
15
|
+
readonly source: ForgeOutageRetrySource;
|
|
16
|
+
readonly error: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface ForgeOutageRetryPolicyField {
|
|
19
|
+
readonly name: typeof FIELD_FORGE_OUTAGE_RETRY_MINUTES;
|
|
20
|
+
readonly current: number;
|
|
21
|
+
readonly default: number;
|
|
22
|
+
readonly source: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ResolveForgeOutageRetryOptions {
|
|
25
|
+
readonly projectRoot?: string | null;
|
|
26
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
27
|
+
readonly userMdText?: string | null;
|
|
28
|
+
}
|
|
29
|
+
/** Validate a raw integer-minutes value. */
|
|
30
|
+
export declare function validateForgeOutageRetryMinutes(raw: unknown): string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Parse USER.md Personal forge-outage retry minutes.
|
|
33
|
+
*
|
|
34
|
+
* Accepts `forgeOutageRetryMinutes: 15` or `Forge outage retry: 15m`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseForgeOutageRetryMinutesFromUserMd(text: string): number | null;
|
|
37
|
+
/**
|
|
38
|
+
* Resolve forge-outage re-probe minutes (#3422).
|
|
39
|
+
*
|
|
40
|
+
* 1. Valid USER.md Personal value
|
|
41
|
+
* 2. Valid plan.policy.forgeOutageRetryMinutes
|
|
42
|
+
* 3. Framework default 30
|
|
43
|
+
*/
|
|
44
|
+
export declare function resolveForgeOutageRetryMinutes(options?: ResolveForgeOutageRetryOptions): ForgeOutageRetryResolved;
|
|
45
|
+
/** Inspector row for `task policy:show --field=forgeOutageRetryMinutes`. */
|
|
46
|
+
export declare function inspectForgeOutageRetryMinutes(_data: Record<string, unknown> | null, projectRoot?: string): ForgeOutageRetryPolicyField;
|
|
47
|
+
//# sourceMappingURL=forge-outage-retry.d.ts.map
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed plan.policy.forgeOutageRetryMinutes (#3422).
|
|
3
|
+
*
|
|
4
|
+
* Re-probe interval after a forge / SCM API outage drop-back.
|
|
5
|
+
* Precedence: USER.md Personal > project policy > framework default 30.
|
|
6
|
+
* Integer minutes, minimum 5.
|
|
7
|
+
*/
|
|
8
|
+
import { readFileSync } from "node:fs";
|
|
9
|
+
import { resolveUserMdPath } from "../user-config/resolve-user-md.js";
|
|
10
|
+
import { readPlanPolicy } from "./plan-extensions.js";
|
|
11
|
+
import { loadProjectDefinition } from "./resolve.js";
|
|
12
|
+
export const FIELD_FORGE_OUTAGE_RETRY_MINUTES = "plan.policy.forgeOutageRetryMinutes";
|
|
13
|
+
export const FIELD_FORGE_OUTAGE_RETRY_MINUTES_CLI_ALIAS = "forgeOutageRetryMinutes";
|
|
14
|
+
export const DEFAULT_FORGE_OUTAGE_RETRY_MINUTES = 30;
|
|
15
|
+
export const MIN_FORGE_OUTAGE_RETRY_MINUTES = 5;
|
|
16
|
+
/** Validate a raw integer-minutes value. */
|
|
17
|
+
export function validateForgeOutageRetryMinutes(raw) {
|
|
18
|
+
if (typeof raw !== "number" || !Number.isInteger(raw)) {
|
|
19
|
+
return (`${FIELD_FORGE_OUTAGE_RETRY_MINUTES} must be an integer >= ` +
|
|
20
|
+
`${MIN_FORGE_OUTAGE_RETRY_MINUTES}; got ${typeof raw}`);
|
|
21
|
+
}
|
|
22
|
+
if (raw < MIN_FORGE_OUTAGE_RETRY_MINUTES) {
|
|
23
|
+
return (`${FIELD_FORGE_OUTAGE_RETRY_MINUTES} must be >= ` +
|
|
24
|
+
`${MIN_FORGE_OUTAGE_RETRY_MINUTES}; got ${raw}`);
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Parse USER.md Personal forge-outage retry minutes.
|
|
30
|
+
*
|
|
31
|
+
* Accepts `forgeOutageRetryMinutes: 15` or `Forge outage retry: 15m`.
|
|
32
|
+
*/
|
|
33
|
+
export function parseForgeOutageRetryMinutesFromUserMd(text) {
|
|
34
|
+
const lines = text.split(/\r?\n/);
|
|
35
|
+
let inPersonal = false;
|
|
36
|
+
for (const line of lines) {
|
|
37
|
+
const trimmed = line.trim();
|
|
38
|
+
if (/^##\s+personal\b/i.test(trimmed)) {
|
|
39
|
+
inPersonal = true;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (inPersonal && /^##\s+/.test(trimmed)) {
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
if (!inPersonal)
|
|
46
|
+
continue;
|
|
47
|
+
const stripped = trimmed.replace(/\*\*/g, "").replace(/^-\s*/, "");
|
|
48
|
+
const keyed = stripped.match(/^forgeOutageRetryMinutes\s*:\s*(.+)$/i);
|
|
49
|
+
const labeled = stripped.match(/^Forge outage retry\s*:\s*(.+)$/i);
|
|
50
|
+
const raw = keyed?.[1] ?? labeled?.[1];
|
|
51
|
+
if (raw === undefined)
|
|
52
|
+
continue;
|
|
53
|
+
const parsed = parseMinutesToken(raw);
|
|
54
|
+
if (parsed !== null)
|
|
55
|
+
return parsed;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function parseMinutesToken(raw) {
|
|
60
|
+
const token = raw.replace(/\*\*/g, "").trim();
|
|
61
|
+
const match = token.match(/^(\d+)\s*(?:m(?:in(?:ute)?s?)?)?$/i);
|
|
62
|
+
if (match?.[1] === undefined)
|
|
63
|
+
return null;
|
|
64
|
+
const minutes = Number(match[1]);
|
|
65
|
+
if (!Number.isInteger(minutes))
|
|
66
|
+
return null;
|
|
67
|
+
return minutes;
|
|
68
|
+
}
|
|
69
|
+
function readUserMdText(options) {
|
|
70
|
+
if (options.userMdText !== undefined) {
|
|
71
|
+
return options.userMdText;
|
|
72
|
+
}
|
|
73
|
+
const projectRoot = options.projectRoot ?? process.cwd();
|
|
74
|
+
const resolved = resolveUserMdPath({
|
|
75
|
+
projectRoot,
|
|
76
|
+
env: options.env ?? process.env,
|
|
77
|
+
});
|
|
78
|
+
if (!resolved.found)
|
|
79
|
+
return null;
|
|
80
|
+
try {
|
|
81
|
+
return readFileSync(resolved.path, { encoding: "utf8" });
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function readProjectMinutes(projectRoot) {
|
|
88
|
+
const [data, err] = loadProjectDefinition(projectRoot);
|
|
89
|
+
if (data === null) {
|
|
90
|
+
return { present: false, minutes: null, error: err };
|
|
91
|
+
}
|
|
92
|
+
const policyBlock = readPlanPolicy(data.plan);
|
|
93
|
+
if (typeof policyBlock !== "object" ||
|
|
94
|
+
policyBlock === null ||
|
|
95
|
+
Array.isArray(policyBlock) ||
|
|
96
|
+
!("forgeOutageRetryMinutes" in policyBlock)) {
|
|
97
|
+
return { present: false, minutes: null, error: null };
|
|
98
|
+
}
|
|
99
|
+
const raw = policyBlock.forgeOutageRetryMinutes;
|
|
100
|
+
if (raw === null) {
|
|
101
|
+
return { present: false, minutes: null, error: null };
|
|
102
|
+
}
|
|
103
|
+
const validationError = validateForgeOutageRetryMinutes(raw);
|
|
104
|
+
if (validationError !== null) {
|
|
105
|
+
return { present: true, minutes: null, error: validationError };
|
|
106
|
+
}
|
|
107
|
+
return { present: true, minutes: raw, error: null };
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Resolve forge-outage re-probe minutes (#3422).
|
|
111
|
+
*
|
|
112
|
+
* 1. Valid USER.md Personal value
|
|
113
|
+
* 2. Valid plan.policy.forgeOutageRetryMinutes
|
|
114
|
+
* 3. Framework default 30
|
|
115
|
+
*/
|
|
116
|
+
export function resolveForgeOutageRetryMinutes(options = {}) {
|
|
117
|
+
const userMdText = readUserMdText(options);
|
|
118
|
+
if (userMdText !== null) {
|
|
119
|
+
const personal = parseForgeOutageRetryMinutesFromUserMd(userMdText);
|
|
120
|
+
if (personal !== null) {
|
|
121
|
+
const personalError = validateForgeOutageRetryMinutes(personal);
|
|
122
|
+
if (personalError === null) {
|
|
123
|
+
return { minutes: personal, source: "user-md", error: null };
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const projectRoot = options.projectRoot;
|
|
128
|
+
if (projectRoot !== undefined && projectRoot !== null && projectRoot.length > 0) {
|
|
129
|
+
const project = readProjectMinutes(projectRoot);
|
|
130
|
+
if (project.minutes !== null) {
|
|
131
|
+
return { minutes: project.minutes, source: "typed", error: null };
|
|
132
|
+
}
|
|
133
|
+
if (project.present && project.error !== null) {
|
|
134
|
+
return {
|
|
135
|
+
minutes: DEFAULT_FORGE_OUTAGE_RETRY_MINUTES,
|
|
136
|
+
source: "default-on-error",
|
|
137
|
+
error: project.error,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
minutes: DEFAULT_FORGE_OUTAGE_RETRY_MINUTES,
|
|
143
|
+
source: "default",
|
|
144
|
+
error: null,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/** Inspector row for `task policy:show --field=forgeOutageRetryMinutes`. */
|
|
148
|
+
export function inspectForgeOutageRetryMinutes(_data, projectRoot) {
|
|
149
|
+
const resolved = resolveForgeOutageRetryMinutes({ projectRoot });
|
|
150
|
+
return {
|
|
151
|
+
name: FIELD_FORGE_OUTAGE_RETRY_MINUTES,
|
|
152
|
+
current: resolved.minutes,
|
|
153
|
+
default: DEFAULT_FORGE_OUTAGE_RETRY_MINUTES,
|
|
154
|
+
source: resolved.source,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=forge-outage-retry.js.map
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { HookHost } from "../hooks/dispatcher.js";
|
|
2
|
+
export type { HookHost };
|
|
2
3
|
export declare const FIELD_HOST_HOOKS = "plan.policy.hostHooks";
|
|
3
4
|
export declare const FIELD_HOST_HOOKS_CLI_ALIAS = "hostHooks";
|
|
5
|
+
export declare const DISABLE_HOST_HOOKS_SUBCOMMAND = "disable-host-hooks";
|
|
6
|
+
/** Confirm-gated disable verb for unused-host recovery copy (#3571). CLI form: no go-task `--`. */
|
|
7
|
+
export declare function disableHostHooksInvocation(trailing?: string): string;
|
|
8
|
+
export declare const HOST_HOOKS_DISABLE_CAPABILITY_COST_DISCLOSURE: string;
|
|
9
|
+
export declare const UNUSED_HOST_HOOKS_RECOVERY: string;
|
|
4
10
|
/** Per-host Directive hook deposit toggles (#2752). */
|
|
5
11
|
export type HostHooksPolicy = Record<HookHost, boolean>;
|
|
6
12
|
export declare const DEFAULT_HOST_HOOKS_POLICY: HostHooksPolicy;
|
|
@@ -18,4 +24,18 @@ export declare function isHostHookDepositEnabled(host: HookHost, policy?: HostHo
|
|
|
18
24
|
export declare function inspectHostHooks(data: Record<string, unknown> | null): HostHooksPolicyField;
|
|
19
25
|
/** Resolve host hook deposit policy from PROJECT-DEFINITION on disk. */
|
|
20
26
|
export declare function loadHostHooksPolicyFromProject(projectRoot: string): HostHooksPolicy;
|
|
27
|
+
export declare function parseHookHost(value: string | undefined): HookHost | null;
|
|
28
|
+
export interface DisableHostHooksOptions {
|
|
29
|
+
readonly host: HookHost;
|
|
30
|
+
readonly confirm: boolean;
|
|
31
|
+
readonly actor?: string;
|
|
32
|
+
readonly note?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface DisableHostHooksResult {
|
|
35
|
+
readonly exitCode: 0 | 1 | 2;
|
|
36
|
+
readonly stdout: string;
|
|
37
|
+
readonly changed: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** Persist `hostHooks.<host>=false` after capability-cost disclosure (#3571). */
|
|
40
|
+
export declare function disableHostHooks(projectRoot: string, options: DisableHostHooksOptions): DisableHostHooksResult;
|
|
21
41
|
//# sourceMappingURL=host-hooks.d.ts.map
|
|
@@ -1,8 +1,36 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
1
2
|
import { HOOK_HOSTS } from "../hooks/dispatcher.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { atomicWriteProjectDefinition, projectDefinitionMutationLock, } from "../vbrief-build/project-definition-io.js";
|
|
4
|
+
import { migrateLegacyPolicyKey, PLAN_POLICY_KEY, readPlanPolicy } from "./plan-extensions.js";
|
|
5
|
+
import { policyColonInvocation } from "./policy-invocation.js";
|
|
6
|
+
import { appendAuditLog, loadProjectDefinition, POLICY_AUDIT_NOOP_STDOUT, projectDefinitionPath, } from "./resolve.js";
|
|
4
7
|
export const FIELD_HOST_HOOKS = "plan.policy.hostHooks";
|
|
5
8
|
export const FIELD_HOST_HOOKS_CLI_ALIAS = "hostHooks";
|
|
9
|
+
export const DISABLE_HOST_HOOKS_SUBCOMMAND = "disable-host-hooks";
|
|
10
|
+
/** Confirm-gated disable verb for unused-host recovery copy (#3571). CLI form: no go-task `--`. */
|
|
11
|
+
export function disableHostHooksInvocation(trailing = " --host <host> --confirm") {
|
|
12
|
+
return policyColonInvocation(DISABLE_HOST_HOOKS_SUBCOMMAND, trailing);
|
|
13
|
+
}
|
|
14
|
+
export const HOST_HOOKS_DISABLE_CAPABILITY_COST_DISCLOSURE = "\u26a0 Capability-cost disclosure -- disabling hostHooks for a host removes " +
|
|
15
|
+
"deft-hook pre-execution guardrails for anyone who later opens this repo in that host. " +
|
|
16
|
+
"The result is tracked.\n" +
|
|
17
|
+
" \u2022 Opted-out hosts skip Directive hook deposit; leftover-free files write {}.\n" +
|
|
18
|
+
" \u2022 This is not a timeout or live-probe fix. Retry the gated ritual when load is the cause.\n" +
|
|
19
|
+
" \u2022 Inspect: `" +
|
|
20
|
+
policyColonInvocation("show", " --field=hostHooks") +
|
|
21
|
+
"`.\n" +
|
|
22
|
+
" \u2022 Apply: `" +
|
|
23
|
+
disableHostHooksInvocation() +
|
|
24
|
+
"`.\n" +
|
|
25
|
+
" \u2022 Reversible: set the host back to true and run `deft update`.\n" +
|
|
26
|
+
" \u2022 Hand-edit of plan.policy.hostHooks plus `deft update` still strips " +
|
|
27
|
+
"(human high-trust bypass).\n" +
|
|
28
|
+
" \u2022 Changes are recorded to meta/policy-changes.log for auditability.";
|
|
29
|
+
export const UNUSED_HOST_HOOKS_RECOVERY = "If an affected host is unused, inspect `" +
|
|
30
|
+
policyColonInvocation("show", " --field=hostHooks") +
|
|
31
|
+
"`, then run `" +
|
|
32
|
+
disableHostHooksInvocation() +
|
|
33
|
+
"`. That removes deft-hook pre-execution guardrails for that host and the result is tracked.";
|
|
6
34
|
export const DEFAULT_HOST_HOOKS_POLICY = {
|
|
7
35
|
claude: true,
|
|
8
36
|
cursor: true,
|
|
@@ -93,4 +121,95 @@ export function loadHostHooksPolicyFromProject(projectRoot) {
|
|
|
93
121
|
}
|
|
94
122
|
return resolveHostHooksPolicy(policyBlock.hostHooks);
|
|
95
123
|
}
|
|
124
|
+
export function parseHookHost(value) {
|
|
125
|
+
if (value === undefined)
|
|
126
|
+
return null;
|
|
127
|
+
return HOOK_HOSTS.includes(value) ? value : null;
|
|
128
|
+
}
|
|
129
|
+
/** Persist `hostHooks.<host>=false` after capability-cost disclosure (#3571). */
|
|
130
|
+
export function disableHostHooks(projectRoot, options) {
|
|
131
|
+
if (!HOOK_HOSTS.includes(options.host)) {
|
|
132
|
+
return {
|
|
133
|
+
exitCode: 2,
|
|
134
|
+
stdout: `\u274c ${FIELD_HOST_HOOKS}.${String(options.host)} is not a deposited host (${HOOK_HOSTS.join(", ")}).\n`,
|
|
135
|
+
changed: false,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (!options.confirm) {
|
|
139
|
+
return {
|
|
140
|
+
exitCode: 1,
|
|
141
|
+
stdout: `${HOST_HOOKS_DISABLE_CAPABILITY_COST_DISCLOSURE}\n\n` +
|
|
142
|
+
`Re-run with --confirm to apply: ${disableHostHooksInvocation(` --host ${options.host} --confirm`)}\n`,
|
|
143
|
+
changed: false,
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
const path = projectDefinitionPath(projectRoot);
|
|
147
|
+
try {
|
|
148
|
+
const { changed } = projectDefinitionMutationLock(projectRoot, () => {
|
|
149
|
+
const parsed = JSON.parse(readFileSync(path, { encoding: "utf8" }));
|
|
150
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
151
|
+
throw new Error(`PROJECT-DEFINITION at ${path} top-level value is not a JSON object`);
|
|
152
|
+
}
|
|
153
|
+
const data = parsed;
|
|
154
|
+
if (typeof data.plan !== "object" || data.plan === null || Array.isArray(data.plan)) {
|
|
155
|
+
if (data.plan === undefined) {
|
|
156
|
+
data.plan = {};
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
throw new Error("PROJECT-DEFINITION 'plan' is not an object");
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const plan = data.plan;
|
|
163
|
+
const legacyKeyMigrated = migrateLegacyPolicyKey(plan);
|
|
164
|
+
const existingPolicy = plan[PLAN_POLICY_KEY];
|
|
165
|
+
if (typeof existingPolicy !== "object" ||
|
|
166
|
+
existingPolicy === null ||
|
|
167
|
+
Array.isArray(existingPolicy)) {
|
|
168
|
+
if (existingPolicy === undefined) {
|
|
169
|
+
plan[PLAN_POLICY_KEY] = {};
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
throw new Error("plan.policy is not an object");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const policyBlock = plan[PLAN_POLICY_KEY];
|
|
176
|
+
const previous = resolveHostHooksPolicy(policyBlock.hostHooks);
|
|
177
|
+
const next = { ...previous, [options.host]: false };
|
|
178
|
+
const changedFlag = previous[options.host] !== false || legacyKeyMigrated;
|
|
179
|
+
policyBlock.hostHooks = next;
|
|
180
|
+
if (changedFlag) {
|
|
181
|
+
atomicWriteProjectDefinition(path, data);
|
|
182
|
+
}
|
|
183
|
+
const actor = options.actor ?? disableHostHooksInvocation();
|
|
184
|
+
const note = options.note ?? "";
|
|
185
|
+
const parts = [
|
|
186
|
+
`actor=${actor}`,
|
|
187
|
+
`${FIELD_HOST_HOOKS}.${options.host}=false`,
|
|
188
|
+
`previous=${JSON.stringify(previous)}`,
|
|
189
|
+
];
|
|
190
|
+
if (note) {
|
|
191
|
+
parts.push(`note=${note.replace(/\n/g, " ").replace(/\r/g, " ")}`);
|
|
192
|
+
}
|
|
193
|
+
appendAuditLog(projectRoot, parts.join(" "), changedFlag);
|
|
194
|
+
return { changed: changedFlag };
|
|
195
|
+
});
|
|
196
|
+
const lines = [
|
|
197
|
+
`\u2713 ${FIELD_HOST_HOOKS}.${options.host}=false (deft-hook guardrails removed for ${options.host}; result is tracked).`,
|
|
198
|
+
changed ? " audit: meta/policy-changes.log updated." : POLICY_AUDIT_NOOP_STDOUT,
|
|
199
|
+
" Run `deft update` to strip Directive-managed hook entries for that host.",
|
|
200
|
+
];
|
|
201
|
+
return { exitCode: 0, stdout: `${lines.join("\n")}\n`, changed };
|
|
202
|
+
}
|
|
203
|
+
catch (err) {
|
|
204
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
205
|
+
if (message.includes("ENOENT") || message.includes("PROJECT-DEFINITION not found")) {
|
|
206
|
+
return {
|
|
207
|
+
exitCode: 2,
|
|
208
|
+
stdout: `\u274c PROJECT-DEFINITION not found at ${path}\n`,
|
|
209
|
+
changed: false,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
return { exitCode: 2, stdout: `\u274c Config error: ${message}\n`, changed: false };
|
|
213
|
+
}
|
|
214
|
+
}
|
|
96
215
|
//# sourceMappingURL=host-hooks.js.map
|
package/dist/policy/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./ac-pass-banking.js";
|
|
2
2
|
export * from "./agents-md-advisory.js";
|
|
3
3
|
export * from "./autonomy.js";
|
|
4
|
+
export * from "./base-branch.js";
|
|
5
|
+
export * from "./branch-sync.js";
|
|
4
6
|
export * from "./capacity.js";
|
|
5
7
|
export * from "./ceremony-dial.js";
|
|
6
8
|
export * from "./ceremony-dial-escalation.js";
|
|
@@ -10,6 +12,8 @@ export * from "./decisions.js";
|
|
|
10
12
|
export * from "./deft-directive-disable.js";
|
|
11
13
|
export * from "./delivery-branch.js";
|
|
12
14
|
export * from "./disclosure.js";
|
|
15
|
+
export * from "./file-size-thresholds.js";
|
|
16
|
+
export * from "./forge-outage-retry.js";
|
|
13
17
|
export * from "./host-hooks.js";
|
|
14
18
|
export * from "./host-slash-commands.js";
|
|
15
19
|
export * from "./hotfix-criteria.js";
|
|
@@ -21,10 +25,13 @@ export * from "./org-force-on-migration.js";
|
|
|
21
25
|
export * from "./plan-extensions.js";
|
|
22
26
|
export * from "./policy-invocation.js";
|
|
23
27
|
export * from "./product-signal.js";
|
|
28
|
+
export * from "./project-invariants.js";
|
|
24
29
|
export * from "./require-human-merge.js";
|
|
25
30
|
export * from "./resolve.js";
|
|
26
31
|
export * from "./runtime-authority.js";
|
|
27
32
|
export * from "./staleness-tickler.js";
|
|
33
|
+
export * from "./sync-default.js";
|
|
34
|
+
export * from "./sync-max-files.js";
|
|
28
35
|
export * from "./value-feedback.js";
|
|
29
36
|
export * from "./value-feedback-autoenable.js";
|
|
30
37
|
export * from "./wip.js";
|
package/dist/policy/index.js
CHANGED
|
@@ -1,25 +1,31 @@
|
|
|
1
1
|
import { FIELD_HOST_SKILL_DISCOVERY, FIELD_HOST_SKILL_DISCOVERY_CLI_ALIAS, inspectHostSkillDiscovery, } from "../init-deposit/skill-discovery-hosts.js";
|
|
2
2
|
import { FIELD_OPENCLAW_PRODUCT_COMMANDS, FIELD_OPENCLAW_PRODUCT_COMMANDS_CLI_ALIAS, inspectOpenClawProductCommands, } from "../slash/openclaw-deposit.js";
|
|
3
3
|
import { FIELD_AC_PASS_BANKING, FIELD_AC_PASS_BANKING_CLI_ALIAS, inspectAcPassBanking, } from "./ac-pass-banking.js";
|
|
4
|
+
import { FIELD_BASE_BRANCH, FIELD_BASE_BRANCH_CLI_ALIAS, inspectBaseBranch, } from "./base-branch.js";
|
|
4
5
|
import { FIELD_CEREMONY_DIAL, FIELD_CEREMONY_DIAL_CLI_ALIAS, inspectCeremonyDial, } from "./ceremony-dial.js";
|
|
5
6
|
import { FIELD_CHECK_RESUME, FIELD_CHECK_RESUME_CLI_ALIAS, inspectCheckResume, } from "./check-resume.js";
|
|
6
7
|
import { FIELD_COVERAGE_DEBT, FIELD_COVERAGE_DEBT_CLI_ALIAS, inspectCoverageDebt, } from "./coverage-debt.js";
|
|
7
8
|
import { FIELD_DELIVERY_BRANCH, FIELD_DELIVERY_BRANCH_CLI_ALIAS, inspectDeliveryBranch, } from "./delivery-branch.js";
|
|
9
|
+
import { FIELD_FORGE_OUTAGE_RETRY_MINUTES, FIELD_FORGE_OUTAGE_RETRY_MINUTES_CLI_ALIAS, inspectForgeOutageRetryMinutes, } from "./forge-outage-retry.js";
|
|
8
10
|
import { FIELD_HOST_HOOKS, FIELD_HOST_HOOKS_CLI_ALIAS, inspectHostHooks } from "./host-hooks.js";
|
|
9
11
|
import { FIELD_HOST_SLASH_COMMANDS, FIELD_HOST_SLASH_COMMANDS_CLI_ALIAS, inspectHostSlashCommands, } from "./host-slash-commands.js";
|
|
10
12
|
import { FIELD_HOTFIX_CRITERIA, FIELD_HOTFIX_CRITERIA_CLI_ALIAS, inspectHotfixCriteria, } from "./hotfix-criteria.js";
|
|
11
13
|
import { FIELD_MIN_GREPTILE_CONFIDENCE, FIELD_MIN_GREPTILE_CONFIDENCE_CLI_ALIAS, inspectMinGreptileConfidence, } from "./min-greptile-confidence.js";
|
|
12
14
|
import { readPlanPolicy } from "./plan-extensions.js";
|
|
13
15
|
import { FIELD_PRODUCT_SIGNAL, FIELD_PRODUCT_SIGNAL_CLI_ALIAS, inspectProductSignal, } from "./product-signal.js";
|
|
16
|
+
import { FIELD_PROJECT_INVARIANTS, FIELD_PROJECT_INVARIANTS_CLI_ALIAS, inspectProjectInvariants, } from "./project-invariants.js";
|
|
14
17
|
import { FIELD_REQUIRE_HUMAN_MERGE, FIELD_REQUIRE_HUMAN_MERGE_CLI_ALIAS, inspectRequireHumanMerge, } from "./require-human-merge.js";
|
|
15
18
|
import { coerceLegacyNarrative, LEGACY_NARRATIVE_KEY, loadProjectDefinition } from "./resolve.js";
|
|
16
19
|
import { FIELD_RUNTIME_AUTHORITY, FIELD_RUNTIME_AUTHORITY_CLI_ALIAS, inspectRuntimeAuthority, } from "./runtime-authority.js";
|
|
17
20
|
import { FIELD_STALENESS_TICKLER, FIELD_STALENESS_TICKLER_CLI_ALIAS, inspectStalenessTickler, } from "./staleness-tickler.js";
|
|
21
|
+
import { FIELD_SYNC_MAX_FILES, FIELD_SYNC_MAX_FILES_CLI_ALIAS, inspectSyncMaxFiles, } from "./sync-max-files.js";
|
|
18
22
|
import { FIELD_VALUE_FEEDBACK, FIELD_VALUE_FEEDBACK_CLI_ALIAS, inspectValueFeedback, } from "./value-feedback.js";
|
|
19
23
|
import { DEFAULT_WIP_CAP } from "./wip.js";
|
|
20
24
|
export * from "./ac-pass-banking.js";
|
|
21
25
|
export * from "./agents-md-advisory.js";
|
|
22
26
|
export * from "./autonomy.js";
|
|
27
|
+
export * from "./base-branch.js";
|
|
28
|
+
export * from "./branch-sync.js";
|
|
23
29
|
export * from "./capacity.js";
|
|
24
30
|
export * from "./ceremony-dial.js";
|
|
25
31
|
export * from "./ceremony-dial-escalation.js";
|
|
@@ -29,6 +35,8 @@ export * from "./decisions.js";
|
|
|
29
35
|
export * from "./deft-directive-disable.js";
|
|
30
36
|
export * from "./delivery-branch.js";
|
|
31
37
|
export * from "./disclosure.js";
|
|
38
|
+
export * from "./file-size-thresholds.js";
|
|
39
|
+
export * from "./forge-outage-retry.js";
|
|
32
40
|
export * from "./host-hooks.js";
|
|
33
41
|
export * from "./host-slash-commands.js";
|
|
34
42
|
export * from "./hotfix-criteria.js";
|
|
@@ -40,10 +48,13 @@ export * from "./org-force-on-migration.js";
|
|
|
40
48
|
export * from "./plan-extensions.js";
|
|
41
49
|
export * from "./policy-invocation.js";
|
|
42
50
|
export * from "./product-signal.js";
|
|
51
|
+
export * from "./project-invariants.js";
|
|
43
52
|
export * from "./require-human-merge.js";
|
|
44
53
|
export * from "./resolve.js";
|
|
45
54
|
export * from "./runtime-authority.js";
|
|
46
55
|
export * from "./staleness-tickler.js";
|
|
56
|
+
export * from "./sync-default.js";
|
|
57
|
+
export * from "./sync-max-files.js";
|
|
47
58
|
export * from "./value-feedback.js";
|
|
48
59
|
export * from "./value-feedback-autoenable.js";
|
|
49
60
|
export * from "./wip.js";
|
|
@@ -404,6 +415,15 @@ function inspectDeliveryBranchField(data, projectRoot) {
|
|
|
404
415
|
source: field.source,
|
|
405
416
|
};
|
|
406
417
|
}
|
|
418
|
+
function inspectBaseBranchField(data, projectRoot) {
|
|
419
|
+
const field = inspectBaseBranch(data, projectRoot);
|
|
420
|
+
return {
|
|
421
|
+
name: field.name,
|
|
422
|
+
current: field.current,
|
|
423
|
+
default: field.default,
|
|
424
|
+
source: field.source,
|
|
425
|
+
};
|
|
426
|
+
}
|
|
407
427
|
function inspectMinGreptileConfidenceField(data, projectRoot) {
|
|
408
428
|
const field = inspectMinGreptileConfidence(data, projectRoot);
|
|
409
429
|
return {
|
|
@@ -431,6 +451,33 @@ function inspectAcPassBankingField(data, projectRoot) {
|
|
|
431
451
|
source: field.source,
|
|
432
452
|
};
|
|
433
453
|
}
|
|
454
|
+
function inspectSyncMaxFilesField(data, projectRoot) {
|
|
455
|
+
const field = inspectSyncMaxFiles(data, projectRoot);
|
|
456
|
+
return {
|
|
457
|
+
name: field.name,
|
|
458
|
+
current: field.current,
|
|
459
|
+
default: field.default,
|
|
460
|
+
source: field.source,
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
function inspectForgeOutageRetryMinutesField(data, projectRoot) {
|
|
464
|
+
const field = inspectForgeOutageRetryMinutes(data, projectRoot);
|
|
465
|
+
return {
|
|
466
|
+
name: field.name,
|
|
467
|
+
current: field.current,
|
|
468
|
+
default: field.default,
|
|
469
|
+
source: field.source,
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
function inspectProjectInvariantsField(data, projectRoot) {
|
|
473
|
+
const field = inspectProjectInvariants(data, projectRoot);
|
|
474
|
+
return {
|
|
475
|
+
name: field.name,
|
|
476
|
+
current: field.current,
|
|
477
|
+
default: field.default,
|
|
478
|
+
source: field.source,
|
|
479
|
+
};
|
|
480
|
+
}
|
|
434
481
|
const REGISTERED_POLICIES = [
|
|
435
482
|
inspectAllowDirectCommits,
|
|
436
483
|
inspectWipCap,
|
|
@@ -445,6 +492,7 @@ const REGISTERED_POLICIES = [
|
|
|
445
492
|
inspectTriageLabelMirrorField,
|
|
446
493
|
inspectSwarmSubagentBackend,
|
|
447
494
|
inspectDeliveryBranchField,
|
|
495
|
+
inspectBaseBranchField,
|
|
448
496
|
inspectMinGreptileConfidenceField,
|
|
449
497
|
inspectHostHooksField,
|
|
450
498
|
inspectHostSlashCommandsField,
|
|
@@ -460,6 +508,9 @@ const REGISTERED_POLICIES = [
|
|
|
460
508
|
inspectHotfixCriteriaField,
|
|
461
509
|
inspectCeremonyDialField,
|
|
462
510
|
inspectAcPassBankingField,
|
|
511
|
+
inspectSyncMaxFilesField,
|
|
512
|
+
inspectForgeOutageRetryMinutesField,
|
|
513
|
+
inspectProjectInvariantsField,
|
|
463
514
|
];
|
|
464
515
|
/** Walk registered inspectors and return one row per field (#1148). */
|
|
465
516
|
export function inspectAllPolicies(projectRoot) {
|
|
@@ -494,13 +545,21 @@ export function inspectOnePolicy(name, projectRoot) {
|
|
|
494
545
|
? FIELD_HOTFIX_CRITERIA
|
|
495
546
|
: name === FIELD_DELIVERY_BRANCH_CLI_ALIAS
|
|
496
547
|
? FIELD_DELIVERY_BRANCH
|
|
497
|
-
: name ===
|
|
498
|
-
?
|
|
499
|
-
: name ===
|
|
500
|
-
?
|
|
501
|
-
: name ===
|
|
502
|
-
?
|
|
503
|
-
: name
|
|
548
|
+
: name === FIELD_BASE_BRANCH_CLI_ALIAS
|
|
549
|
+
? FIELD_BASE_BRANCH
|
|
550
|
+
: name === FIELD_MIN_GREPTILE_CONFIDENCE_CLI_ALIAS
|
|
551
|
+
? FIELD_MIN_GREPTILE_CONFIDENCE
|
|
552
|
+
: name === FIELD_CEREMONY_DIAL_CLI_ALIAS
|
|
553
|
+
? FIELD_CEREMONY_DIAL
|
|
554
|
+
: name === FIELD_AC_PASS_BANKING_CLI_ALIAS
|
|
555
|
+
? FIELD_AC_PASS_BANKING
|
|
556
|
+
: name === FIELD_SYNC_MAX_FILES_CLI_ALIAS
|
|
557
|
+
? FIELD_SYNC_MAX_FILES
|
|
558
|
+
: name === FIELD_FORGE_OUTAGE_RETRY_MINUTES_CLI_ALIAS
|
|
559
|
+
? FIELD_FORGE_OUTAGE_RETRY_MINUTES
|
|
560
|
+
: name === FIELD_PROJECT_INVARIANTS_CLI_ALIAS
|
|
561
|
+
? FIELD_PROJECT_INVARIANTS
|
|
562
|
+
: name;
|
|
504
563
|
for (const field of inspectAllPolicies(projectRoot)) {
|
|
505
564
|
if (field.name === normalized)
|
|
506
565
|
return field;
|
|
@@ -421,6 +421,7 @@ function applyForceOn(projectRoot, options, intent) {
|
|
|
421
421
|
? existing.previousProductSignal
|
|
422
422
|
: ORG_FORCE_ON_NO_BASELINE;
|
|
423
423
|
const actor = options.actor ?? "directive-update";
|
|
424
|
+
const changed = valueFeedbackChanged || productSignalChanged;
|
|
424
425
|
appendAuditLog(projectRoot, [
|
|
425
426
|
`actor=${actor}`,
|
|
426
427
|
"org-force-on-v2822",
|
|
@@ -428,7 +429,7 @@ function applyForceOn(projectRoot, options, intent) {
|
|
|
428
429
|
`productSignal=${needsPs ? "forced-on" : "unchanged"}`,
|
|
429
430
|
`previousValueFeedback=${JSON.stringify(normalizePolicySnapshot(markerPreviousVf))}`,
|
|
430
431
|
`previousProductSignal=${JSON.stringify(normalizePolicySnapshot(markerPreviousPs))}`,
|
|
431
|
-
].join(" "));
|
|
432
|
+
].join(" "), changed);
|
|
432
433
|
writeMarker(projectRoot, options, {
|
|
433
434
|
// OR with existing so partial re-apply does not clear install-force-on source.
|
|
434
435
|
valueFeedback: needsVf || (existing?.valueFeedback ?? false),
|
|
@@ -41,7 +41,7 @@ export declare function readPlanOnboarding(plan: unknown): unknown;
|
|
|
41
41
|
* policy key is present. Used by writers so a mutation never strands a legacy
|
|
42
42
|
* bare block alongside the namespaced one.
|
|
43
43
|
*/
|
|
44
|
-
export declare function migrateLegacyPolicyKey(plan: Record<string, unknown>):
|
|
44
|
+
export declare function migrateLegacyPolicyKey(plan: Record<string, unknown>): boolean;
|
|
45
45
|
/** The namespaced/legacy key pairs a bare block can silently shadow (#2301). */
|
|
46
46
|
export declare const SHADOWABLE_PLAN_EXTENSIONS: ReadonlyArray<{
|
|
47
47
|
readonly namespacedKey: string;
|
|
@@ -68,7 +68,9 @@ export function migrateLegacyPolicyKey(plan) {
|
|
|
68
68
|
if (plan[PLAN_POLICY_KEY] === undefined && plan[LEGACY_PLAN_POLICY_KEY] !== undefined) {
|
|
69
69
|
plan[PLAN_POLICY_KEY] = plan[LEGACY_PLAN_POLICY_KEY];
|
|
70
70
|
delete plan[LEGACY_PLAN_POLICY_KEY];
|
|
71
|
+
return true;
|
|
71
72
|
}
|
|
73
|
+
return false;
|
|
72
74
|
}
|
|
73
75
|
/** The namespaced/legacy key pairs a bare block can silently shadow (#2301). */
|
|
74
76
|
export const SHADOWABLE_PLAN_EXTENSIONS = [
|
|
@@ -3,7 +3,7 @@ import { atomicWriteProjectDefinition, projectDefinitionMutationLock, } from "..
|
|
|
3
3
|
import { productSignalInstallForceOnSource } from "./org-force-on-migration.js";
|
|
4
4
|
import { migrateLegacyPolicyKey, PLAN_POLICY_KEY, readPlanPolicy } from "./plan-extensions.js";
|
|
5
5
|
import { policyColonInvocation } from "./policy-invocation.js";
|
|
6
|
-
import { appendAuditLog, loadProjectDefinition, projectDefinitionPath } from "./resolve.js";
|
|
6
|
+
import { appendAuditLog, loadProjectDefinition, POLICY_AUDIT_NOOP_STDOUT, projectDefinitionPath, } from "./resolve.js";
|
|
7
7
|
/** Canonical registered policy field name (#2693). */
|
|
8
8
|
export const FIELD_PRODUCT_SIGNAL = "plan.policy.productSignal";
|
|
9
9
|
/** Short alias for `policy:show --field=productSignal`. */
|
|
@@ -157,7 +157,7 @@ export function enableProductSignal(projectRoot, options) {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
const plan = data.plan;
|
|
160
|
-
migrateLegacyPolicyKey(plan);
|
|
160
|
+
const legacyKeyMigrated = migrateLegacyPolicyKey(plan);
|
|
161
161
|
const existingPolicy = plan[PLAN_POLICY_KEY];
|
|
162
162
|
if (typeof existingPolicy !== "object" ||
|
|
163
163
|
existingPolicy === null ||
|
|
@@ -181,7 +181,8 @@ export function enableProductSignal(projectRoot, options) {
|
|
|
181
181
|
const nextBlock = { enabled: true, sinkRepo };
|
|
182
182
|
const previousNormalized = resolveProductSignalFromTypedBlock(previous);
|
|
183
183
|
const changedFlag = previousNormalized.enabled !== nextBlock.enabled ||
|
|
184
|
-
previousNormalized.sinkRepo !== nextBlock.sinkRepo
|
|
184
|
+
previousNormalized.sinkRepo !== nextBlock.sinkRepo ||
|
|
185
|
+
legacyKeyMigrated;
|
|
185
186
|
policyBlock.productSignal = nextBlock;
|
|
186
187
|
if (changedFlag) {
|
|
187
188
|
atomicWriteProjectDefinition(path, data);
|
|
@@ -197,15 +198,13 @@ export function enableProductSignal(projectRoot, options) {
|
|
|
197
198
|
if (note) {
|
|
198
199
|
parts.push(`note=${note.replace(/\n/g, " ").replace(/\r/g, " ")}`);
|
|
199
200
|
}
|
|
200
|
-
appendAuditLog(projectRoot, parts.join(" "));
|
|
201
|
+
appendAuditLog(projectRoot, parts.join(" "), changedFlag);
|
|
201
202
|
return { changed: changedFlag };
|
|
202
203
|
});
|
|
203
204
|
const resolved = resolveProductSignal(projectRoot);
|
|
204
205
|
const lines = [
|
|
205
206
|
`\u2713 ${FIELD_PRODUCT_SIGNAL}.enabled=true (product-signal ON).`,
|
|
206
|
-
changed
|
|
207
|
-
? " audit: meta/policy-changes.log updated."
|
|
208
|
-
: " no-op: value already matched (audit entry still appended for trail).",
|
|
207
|
+
changed ? " audit: meta/policy-changes.log updated." : POLICY_AUDIT_NOOP_STDOUT,
|
|
209
208
|
formatProductSignalStatusLine(resolved),
|
|
210
209
|
];
|
|
211
210
|
return { exitCode: 0, stdout: `${lines.join("\n")}\n`, changed };
|