@deftai/directive-core 0.103.0 → 0.105.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 +682 -35
- package/dist/check/cached-orchestrator.d.ts +1 -1
- package/dist/check/cached-orchestrator.js +2 -2
- package/dist/check/gate-lists.d.ts +3 -2
- package/dist/check/gate-lists.js +5 -2
- package/dist/check/index.d.ts +1 -0
- package/dist/check/index.js +1 -0
- package/dist/check/named-cause.d.ts +1 -1
- package/dist/check/named-cause.js +33 -3
- package/dist/check/session-completed-ac.d.ts +39 -0
- package/dist/check/session-completed-ac.js +198 -0
- 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 -14
- package/dist/doctor/types.d.ts +9 -0
- package/dist/fs/contained-write.d.ts +115 -1
- package/dist/fs/contained-write.js +242 -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 +2 -0
- package/dist/index.js +3 -0
- package/dist/init-deposit/agent-hooks.js +17 -15
- 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 +74 -0
- package/dist/intake/clause-derivation.js +409 -0
- package/dist/intake/index.d.ts +1 -0
- package/dist/intake/index.js +1 -0
- package/dist/intake/issue-ingest.d.ts +3 -1
- package/dist/intake/issue-ingest.js +36 -43
- package/dist/lifecycle/completed-tracked-on-delivery.d.ts +5 -0
- package/dist/lifecycle/completed-tracked-on-delivery.js +85 -18
- package/dist/literal-acceptance/capture.d.ts +10 -0
- package/dist/literal-acceptance/capture.js +224 -75
- 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/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 +4 -14
- 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/index.d.ts +7 -0
- package/dist/policy/index.js +66 -7
- package/dist/policy/project-invariants.d.ts +50 -0
- package/dist/policy/project-invariants.js +205 -0
- 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/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 +9 -0
- package/dist/preflight/evaluate.js +49 -1
- package/dist/preflight/index.d.ts +5 -1
- 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/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 +5 -2
- package/dist/product-first-done-gate/empty-resolution.js +13 -2
- package/dist/product-first-done-gate/evaluate.d.ts +29 -0
- package/dist/product-first-done-gate/evaluate.js +307 -33
- package/dist/product-first-done-gate/index.d.ts +3 -1
- package/dist/product-first-done-gate/index.js +2 -1
- package/dist/release/build-dist.d.ts +101 -0
- package/dist/release/build-dist.js +428 -46
- package/dist/run-summary/emit.d.ts +50 -4
- package/dist/run-summary/emit.js +262 -26
- 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/share.d.ts +1 -1
- package/dist/run-summary/share.js +2 -2
- package/dist/run-summary/types.d.ts +38 -6
- package/dist/run-summary/types.js +1 -0
- package/dist/scope/acceptance-activate-gate.d.ts +1 -1
- package/dist/scope/acceptance-activate-gate.js +4 -4
- package/dist/scope/acceptance-evidence.d.ts +27 -0
- package/dist/scope/acceptance-evidence.js +66 -0
- package/dist/scope/capacity-stamp.d.ts +2 -0
- package/dist/scope/capacity-stamp.js +4 -0
- package/dist/scope/delivery-evidence.d.ts +9 -3
- package/dist/scope/delivery-evidence.js +39 -27
- package/dist/scope/index.d.ts +1 -0
- package/dist/scope/index.js +1 -0
- 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/transition.js +66 -4
- 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 +64 -4
- 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 +4 -36
- package/dist/session/ac-pass-banking.js +30 -77
- package/dist/session/ac-pass-reuse.d.ts +53 -0
- package/dist/session/ac-pass-reuse.js +95 -0
- package/dist/session/ceremony-dial-evidence.d.ts +42 -0
- package/dist/session/ceremony-dial-evidence.js +194 -0
- package/dist/session/git.js +19 -4
- package/dist/session/index.d.ts +5 -0
- package/dist/session/index.js +5 -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/product-state-hash.d.ts +26 -0
- package/dist/session/product-state-hash.js +683 -0
- package/dist/session/session-ready.d.ts +2 -0
- package/dist/session/session-ready.js +52 -30
- package/dist/session/session-start.d.ts +7 -0
- package/dist/session/session-start.js +88 -5
- 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 +5 -0
- package/dist/session/verify-session-ritual.js +9 -0
- 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 +21 -4
- package/dist/slice/lock.d.ts +16 -1
- package/dist/slice/lock.js +137 -11
- package/dist/slice/record.d.ts +8 -5
- package/dist/slice/record.js +21 -13
- 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.js +33 -2
- 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 +13 -3
- package/dist/swarm/routing-verify.d.ts +12 -0
- package/dist/swarm/routing-verify.js +59 -20
- package/dist/swarm/routing.d.ts +14 -0
- package/dist/swarm/routing.js +53 -3
- package/dist/telemetry-coverage/evaluate.d.ts +42 -0
- package/dist/telemetry-coverage/evaluate.js +148 -0
- package/dist/telemetry-coverage/fake-trial.d.ts +45 -0
- package/dist/telemetry-coverage/fake-trial.js +204 -0
- package/dist/telemetry-coverage/index.d.ts +5 -0
- package/dist/telemetry-coverage/index.js +5 -0
- package/dist/telemetry-coverage/kinds.d.ts +19 -0
- package/dist/telemetry-coverage/kinds.js +54 -0
- package/dist/telemetry-coverage/scan-callers.d.ts +25 -0
- package/dist/telemetry-coverage/scan-callers.js +168 -0
- package/dist/triage/actions/index.js +4 -1
- 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/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 +3 -1
- package/dist/vbrief-reconcile/index.js +2 -1
- package/dist/vbrief-reconcile/origin-freshness.d.ts +44 -0
- package/dist/vbrief-reconcile/origin-freshness.js +221 -0
- 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/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-source/contained-writes.js +2 -0
- package/dist/verify-source/index.d.ts +1 -0
- package/dist/verify-source/index.js +1 -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 +3 -3
|
@@ -5,8 +5,8 @@ import { scan } from "../cache/scanner.js";
|
|
|
5
5
|
import { assertWriteTargetSafe, ProjectionContainmentError } from "../fs/projection-containment.js";
|
|
6
6
|
import { hasArtifactSuffix, resolveLifecycleRoot } from "../layout/resolve.js";
|
|
7
7
|
import { captureAndAttachLiteralAcceptance } from "../literal-acceptance/index.js";
|
|
8
|
+
import { stampIntendedPlacement } from "../preflight/intended-placement.js";
|
|
8
9
|
import { stampAcceptanceFromLiteralCapture } from "../product-first-done-gate/index.js";
|
|
9
|
-
import { ENV_RUN_SUMMARY_PATH, RunSummaryEmitter } from "../run-summary/index.js";
|
|
10
10
|
import { call } from "../scm/call.js";
|
|
11
11
|
import { resolveProjectRoot } from "../scope/project-context.js";
|
|
12
12
|
import { resolveProjectRepo } from "../slice/project-context.js";
|
|
@@ -15,6 +15,7 @@ import { slugify, TODAY } from "../vbrief-build/build.js";
|
|
|
15
15
|
import { EMITTED_VBRIEF_VERSION } from "../vbrief-build/constants.js";
|
|
16
16
|
import { stampDerivedClausesOnAcceptance } from "../verify-ac/clauses.js";
|
|
17
17
|
import { LEGACY_ARTIFACT_SUFFIX, LEGACY_INFO_ROOT_KEY, MIGRATED_ARTIFACT_DIR, MIGRATED_ARTIFACT_SUFFIX, MIGRATED_INFO_ROOT_KEY, VBRIEF_VERSION, } from "../xbrief-migrate/constants.js";
|
|
18
|
+
import { applyClauseQualityForIngest, emitAcceptanceStampFromPlan } from "./clause-derivation.js";
|
|
18
19
|
import { findAcHeading, parseCheckboxItems, parseListItems, sliceAcSection, stripCodeBlocks, stripFencedCodeBlocks, } from "./markdown-scanners.js";
|
|
19
20
|
import { detectRepo, extractReferencesFromVbrief, fetchOpenIssues, GITHUB_ISSUE_REF_TYPES, LIFECYCLE_FOLDERS, parseIssueNumber, } from "./reconcile-issues.js";
|
|
20
21
|
/** Reference type pointing at the canonical current-shape comment permalink (#1870). */
|
|
@@ -480,11 +481,13 @@ export function buildIssueVbrief(issue, status, repoUrl, options = {}) {
|
|
|
480
481
|
// #3323: when no commands were stated, derive numbered clauses before product edit.
|
|
481
482
|
const derived = stampDerivedClausesOnAcceptance(plan, [title, overviewSource].filter((s) => s.length > 0).join("\n\n"));
|
|
482
483
|
Object.assign(plan, derived.plan);
|
|
484
|
+
applyClauseQualityForIngest(plan);
|
|
483
485
|
}
|
|
484
486
|
else {
|
|
485
487
|
// No body: still record none_stated acceptance so absence is a decision.
|
|
486
488
|
Object.assign(plan, stampAcceptanceFromLiteralCapture(plan));
|
|
487
489
|
}
|
|
490
|
+
stampIntendedPlacement(plan);
|
|
488
491
|
const infoRootKey = options.infoRootKey ?? LEGACY_INFO_ROOT_KEY;
|
|
489
492
|
const infoVersion = options.infoVersion ?? EMITTED_VBRIEF_VERSION;
|
|
490
493
|
const briefLabel = infoRootKey === MIGRATED_INFO_ROOT_KEY ? "xBRIEF" : "vBRIEF";
|
|
@@ -499,6 +502,24 @@ export function buildIssueVbrief(issue, status, repoUrl, options = {}) {
|
|
|
499
502
|
folder,
|
|
500
503
|
];
|
|
501
504
|
}
|
|
505
|
+
/** Include a refused-stamp remediation on the ingest result so it is not silent. */
|
|
506
|
+
export function formatIngestCreatedMessage(folder, filename, plan, dryRun = false) {
|
|
507
|
+
const lead = dryRun
|
|
508
|
+
? `DRY-RUN would write ${folder}/${filename}`
|
|
509
|
+
: `CREATED ${folder}/${filename}`;
|
|
510
|
+
if (typeof plan !== "object" || plan === null || Array.isArray(plan)) {
|
|
511
|
+
return lead;
|
|
512
|
+
}
|
|
513
|
+
const acceptance = plan.acceptance;
|
|
514
|
+
if (typeof acceptance !== "object" || acceptance === null || Array.isArray(acceptance)) {
|
|
515
|
+
return lead;
|
|
516
|
+
}
|
|
517
|
+
const notice = acceptance.quality_notice;
|
|
518
|
+
if (typeof notice !== "string" || notice.trim().length === 0) {
|
|
519
|
+
return lead;
|
|
520
|
+
}
|
|
521
|
+
return `${lead}\n${notice.trim()}`;
|
|
522
|
+
}
|
|
502
523
|
export function targetFilename(number, title, artifactSuffix = LEGACY_ARTIFACT_SUFFIX) {
|
|
503
524
|
const slug = slugify(title) || `issue-${number}`;
|
|
504
525
|
return `${TODAY}-${number}-${slug}${artifactSuffix}`;
|
|
@@ -707,7 +728,7 @@ export function ingestOne(issue, options) {
|
|
|
707
728
|
const folderPath = join(options.vbriefDir, folder);
|
|
708
729
|
const target = join(folderPath, filename);
|
|
709
730
|
if (options.dryRun) {
|
|
710
|
-
return ["dryrun", target,
|
|
731
|
+
return ["dryrun", target, formatIngestCreatedMessage(folder, filename, vbrief.plan, true)];
|
|
711
732
|
}
|
|
712
733
|
// Gate lifecycle folder + leaf before mkdir/write so folder/parent symlinks
|
|
713
734
|
// cannot divert issue:ingest / triage:accept outside the project (#2869).
|
|
@@ -723,44 +744,8 @@ export function ingestOne(issue, options) {
|
|
|
723
744
|
assertWriteTargetSafe(projectRoot, target);
|
|
724
745
|
mkdirSync(folderPath, { recursive: true });
|
|
725
746
|
writeFileSync(target, `${JSON.stringify(vbrief, null, 2)}\n`, "utf8");
|
|
726
|
-
|
|
727
|
-
return ["created", target,
|
|
728
|
-
}
|
|
729
|
-
function emitIntakeAcceptanceStamp(projectRoot, plan) {
|
|
730
|
-
const rec = plan !== null && typeof plan === "object" && !Array.isArray(plan)
|
|
731
|
-
? plan
|
|
732
|
-
: null;
|
|
733
|
-
if (rec === null) {
|
|
734
|
-
return;
|
|
735
|
-
}
|
|
736
|
-
const acceptance = rec.acceptance !== null && typeof rec.acceptance === "object" && !Array.isArray(rec.acceptance)
|
|
737
|
-
? rec.acceptance
|
|
738
|
-
: null;
|
|
739
|
-
if (acceptance === null) {
|
|
740
|
-
return;
|
|
741
|
-
}
|
|
742
|
-
const env = process.env;
|
|
743
|
-
const dest = env[ENV_RUN_SUMMARY_PATH];
|
|
744
|
-
if (dest === undefined || dest.trim().length === 0) {
|
|
745
|
-
return;
|
|
746
|
-
}
|
|
747
|
-
try {
|
|
748
|
-
const sessionId = typeof env.DEFT_SESSION_ID === "string" && env.DEFT_SESSION_ID.trim().length > 0
|
|
749
|
-
? env.DEFT_SESSION_ID.trim()
|
|
750
|
-
: "issue-ingest";
|
|
751
|
-
const emitter = new RunSummaryEmitter({ projectRoot, sessionId, env });
|
|
752
|
-
const commands = Array.isArray(acceptance.commands) ? acceptance.commands.length : 0;
|
|
753
|
-
const clauses = Array.isArray(acceptance.clauses) ? acceptance.clauses.length : 0;
|
|
754
|
-
emitter.emitAcceptanceStamp({
|
|
755
|
-
rung: typeof acceptance.source_rung === "string" ? acceptance.source_rung : "project_floor",
|
|
756
|
-
none_stated: acceptance.none_stated === true,
|
|
757
|
-
command_count: commands,
|
|
758
|
-
clause_count: clauses,
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
catch {
|
|
762
|
-
// fail-open
|
|
763
|
-
}
|
|
747
|
+
emitAcceptanceStampFromPlan(projectRoot, vbrief.plan);
|
|
748
|
+
return ["created", target, formatIngestCreatedMessage(folder, filename, vbrief.plan)];
|
|
764
749
|
}
|
|
765
750
|
export function ingestBulk(issues, options) {
|
|
766
751
|
let filtered = issues;
|
|
@@ -789,6 +774,7 @@ export function ingestBulk(issues, options) {
|
|
|
789
774
|
duplicate: [],
|
|
790
775
|
dryrun: [],
|
|
791
776
|
failed: [],
|
|
777
|
+
notices: [],
|
|
792
778
|
};
|
|
793
779
|
for (const issue of filtered) {
|
|
794
780
|
let ingested;
|
|
@@ -806,9 +792,12 @@ export function ingestBulk(issues, options) {
|
|
|
806
792
|
}
|
|
807
793
|
throw exc;
|
|
808
794
|
}
|
|
809
|
-
const [result, path,
|
|
795
|
+
const [result, path, msg] = ingested;
|
|
810
796
|
const rel = path !== null ? path.replace(`${options.vbriefDir}/`, "").replace(/\\/g, "/") : "";
|
|
811
797
|
summary[result].push(rel);
|
|
798
|
+
if (msg.includes("\n")) {
|
|
799
|
+
summary.notices.push(msg);
|
|
800
|
+
}
|
|
812
801
|
if (result === "created" && path !== null) {
|
|
813
802
|
const num = Number(issue.number);
|
|
814
803
|
const existing = refs.get(num) ?? [];
|
|
@@ -876,6 +865,9 @@ export function issueIngestMain(args) {
|
|
|
876
865
|
for (const entry of created) {
|
|
877
866
|
process.stdout.write(` CREATED ${entry}\n`);
|
|
878
867
|
}
|
|
868
|
+
for (const notice of summary.notices ?? []) {
|
|
869
|
+
process.stdout.write(`${notice}\n`);
|
|
870
|
+
}
|
|
879
871
|
for (const entry of dryrun) {
|
|
880
872
|
process.stdout.write(` DRY-RUN ${entry}\n`);
|
|
881
873
|
}
|
|
@@ -926,12 +918,13 @@ export function ingestSingleForAccept(n, repo, options = {}) {
|
|
|
926
918
|
if (issue === null) {
|
|
927
919
|
throw new Error(`failed to fetch GitHub issue #${n} from ${repo} (unified cache miss + live gh api fetch failed; see stderr)`);
|
|
928
920
|
}
|
|
929
|
-
|
|
921
|
+
// Forward ingestOne's notice-bearing third return so triage:accept can
|
|
922
|
+
// print a refused-stamp remediation instead of only the decision id (#3398).
|
|
923
|
+
return ingestOne(issue, {
|
|
930
924
|
vbriefDir,
|
|
931
925
|
status: options.status ?? "proposed",
|
|
932
926
|
repoUrl,
|
|
933
927
|
cwd: root,
|
|
934
928
|
});
|
|
935
|
-
return [result, path];
|
|
936
929
|
}
|
|
937
930
|
//# sourceMappingURL=issue-ingest.js.map
|
|
@@ -25,6 +25,11 @@ export interface EvaluateCompletedTrackedOptions {
|
|
|
25
25
|
readonly repo?: string | null;
|
|
26
26
|
/** Explicit delivery tip ref (e.g. origin/master). Overrides policy/git default. */
|
|
27
27
|
readonly tip?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* When set, check only this issue number (#3476 drive-to DONE).
|
|
30
|
+
* Sibling unlanded closed issues do not fail the per-issue scan.
|
|
31
|
+
*/
|
|
32
|
+
readonly issue?: number | null;
|
|
28
33
|
readonly runGh?: RunGhFn;
|
|
29
34
|
readonly skipGh?: boolean;
|
|
30
35
|
readonly runGit?: GitRunner;
|
|
@@ -198,13 +198,16 @@ export function resolveDeliveryTip(projectRoot, tipOverride, runGit) {
|
|
|
198
198
|
return { tip: candidate, error: null };
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
//
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
201
|
+
// ⊗ HEAD fallback (#3478 review). This gate exists to prove an artifact landed
|
|
202
|
+
// on the delivery tip rather than on feature-worktree HEAD; falling back to
|
|
203
|
+
// HEAD when the delivery ref is missing (shallow clone, unfetched worktree,
|
|
204
|
+
// fetch-depth:1 checkout) checks the very branch whose land is in question and
|
|
205
|
+
// silently passes. Unresolvable delivery tip must fail closed -- pass an
|
|
206
|
+
// explicit --tip (e.g. --tip HEAD for an in-flight land PR) to opt in.
|
|
205
207
|
return {
|
|
206
208
|
tip: null,
|
|
207
|
-
error: `could not resolve delivery tip for branch '${branch}' (no origin/${branch}
|
|
209
|
+
error: `could not resolve delivery tip for branch '${branch}' (no origin/${branch} or ${branch}); ` +
|
|
210
|
+
"fetch the delivery branch or pass an explicit --tip",
|
|
208
211
|
};
|
|
209
212
|
}
|
|
210
213
|
function listTreePaths(projectRoot, tip, prefixes, runGit) {
|
|
@@ -270,6 +273,28 @@ function issuesFromBlobPaths(projectRoot, tip, paths, defaultRepo, runGit, origi
|
|
|
270
273
|
}
|
|
271
274
|
return hits;
|
|
272
275
|
}
|
|
276
|
+
/**
|
|
277
|
+
* Narrow the origin map to the requested issue.
|
|
278
|
+
*
|
|
279
|
+
* Matching is repo-scoped when the caller's repo is known (#3478 review): a
|
|
280
|
+
* corpus entry for another repository's same-numbered issue must NOT survive
|
|
281
|
+
* this filter. Letting it through leaves `originMap` non-empty, which suppresses
|
|
282
|
+
* the synthesis below and makes the gate resolve the wrong `repo#number` --
|
|
283
|
+
* a foreign open issue then green-skips an unlanded local one.
|
|
284
|
+
*/
|
|
285
|
+
function filterOriginsByIssue(originMap, issue, repo) {
|
|
286
|
+
const out = new Map();
|
|
287
|
+
for (const [key, entry] of originMap) {
|
|
288
|
+
if (entry.issue.number !== issue) {
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
if (repo !== null && entry.issue.repo !== repo) {
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
out.set(key, entry);
|
|
295
|
+
}
|
|
296
|
+
return out;
|
|
297
|
+
}
|
|
273
298
|
function mergeOrigins(hits) {
|
|
274
299
|
const map = new Map();
|
|
275
300
|
for (const hit of hits) {
|
|
@@ -353,7 +378,47 @@ export function evaluateCompletedTracked(projectRoot, options = {}) {
|
|
|
353
378
|
const localHits = scanLocalOrigins(root, defaultRepo);
|
|
354
379
|
const tipNonterminalPaths = listTreePaths(root, tip, nonterminalPrefixes(), runGit);
|
|
355
380
|
const tipNonterminalHits = issuesFromBlobPaths(root, tip, tipNonterminalPaths, defaultRepo, runGit, `tip:${tip}`);
|
|
356
|
-
|
|
381
|
+
let originMap = mergeOrigins([...localHits, ...tipNonterminalHits]);
|
|
382
|
+
// Delivery tip only — the land invariant is post-merge tip truth (#3264 AC).
|
|
383
|
+
// Lifecycle PRs that commit completed/ on a feature branch are not expected
|
|
384
|
+
// to satisfy this gate until merge; run the verb with --tip HEAD when
|
|
385
|
+
// validating an in-flight land PR. The gate is a standalone verify verb
|
|
386
|
+
// (not wired into check:consumer) so product PRs are not deadlocked.
|
|
387
|
+
const tipTerminalPaths = listTreePaths(root, tip, terminalPrefixes(), runGit);
|
|
388
|
+
const tipTerminalHits = issuesFromBlobPaths(root, tip, tipTerminalPaths, defaultRepo, runGit, `tip:${tip}`);
|
|
389
|
+
const landedKeys = new Set(tipTerminalHits.map((h) => issueKey(h.issue)));
|
|
390
|
+
const issueFilter = options.issue ?? null;
|
|
391
|
+
if (issueFilter !== null) {
|
|
392
|
+
if (!Number.isInteger(issueFilter) || issueFilter <= 0) {
|
|
393
|
+
return {
|
|
394
|
+
code: 2,
|
|
395
|
+
message: `verify:completed-tracked: --issue must be a positive integer (got ${issueFilter})`,
|
|
396
|
+
stream: "stderr",
|
|
397
|
+
missing: [],
|
|
398
|
+
tip,
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
originMap = filterOriginsByIssue(originMap, issueFilter, defaultRepo);
|
|
402
|
+
// Drive-to DONE must not green-skip a named origin with no local brief
|
|
403
|
+
// (#3476). Synthesize the requested issue so closed+unlanded fails.
|
|
404
|
+
if (originMap.size === 0) {
|
|
405
|
+
if (defaultRepo === null) {
|
|
406
|
+
return {
|
|
407
|
+
code: 2,
|
|
408
|
+
message: `verify:completed-tracked: --issue ${issueFilter} requires --repo or a resolvable ` +
|
|
409
|
+
"origin remote when no scoped xBRIEF origin is present.",
|
|
410
|
+
stream: "stderr",
|
|
411
|
+
missing: [],
|
|
412
|
+
tip,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
const synthetic = {
|
|
416
|
+
issue: { repo: defaultRepo, number: issueFilter },
|
|
417
|
+
origins: [`--issue ${issueFilter}`],
|
|
418
|
+
};
|
|
419
|
+
originMap.set(issueKey(synthetic.issue), synthetic);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
357
422
|
if (originMap.size === 0) {
|
|
358
423
|
if (quiet) {
|
|
359
424
|
return { code: 0, message: "", stream: "none", missing: [], tip };
|
|
@@ -366,14 +431,6 @@ export function evaluateCompletedTracked(projectRoot, options = {}) {
|
|
|
366
431
|
tip,
|
|
367
432
|
};
|
|
368
433
|
}
|
|
369
|
-
// Delivery tip only — the land invariant is post-merge tip truth (#3264 AC).
|
|
370
|
-
// Lifecycle PRs that commit completed/ on a feature branch are not expected
|
|
371
|
-
// to satisfy this gate until merge; run the verb with --tip HEAD when
|
|
372
|
-
// validating an in-flight land PR. The gate is a standalone verify verb
|
|
373
|
-
// (not wired into check:consumer) so product PRs are not deadlocked.
|
|
374
|
-
const tipTerminalPaths = listTreePaths(root, tip, terminalPrefixes(), runGit);
|
|
375
|
-
const tipTerminalHits = issuesFromBlobPaths(root, tip, tipTerminalPaths, defaultRepo, runGit, `tip:${tip}`);
|
|
376
|
-
const landedKeys = new Set(tipTerminalHits.map((h) => issueKey(h.issue)));
|
|
377
434
|
const missing = [];
|
|
378
435
|
for (const [key, entry] of originMap) {
|
|
379
436
|
if (landedKeys.has(key)) {
|
|
@@ -383,10 +440,20 @@ export function evaluateCompletedTracked(projectRoot, options = {}) {
|
|
|
383
440
|
if (state === "open") {
|
|
384
441
|
continue;
|
|
385
442
|
}
|
|
386
|
-
// Closed: always fail.
|
|
387
|
-
//
|
|
388
|
-
//
|
|
389
|
-
|
|
443
|
+
// Closed: always fail.
|
|
444
|
+
//
|
|
445
|
+
// Unknown: fail when live lookup was expected (!skipGh) -- cannot prove the
|
|
446
|
+
// issue is still open, so do not green-skip land debt (#3264 Greptile
|
|
447
|
+
// residual on live lookup failure).
|
|
448
|
+
//
|
|
449
|
+
// Unknown also fails for an explicitly named --issue even under --skip-gh
|
|
450
|
+
// (#3478 review): that is the drive-to DONE form, where the caller asserts
|
|
451
|
+
// this specific issue is done. An uncached issue must not exit 0 there --
|
|
452
|
+
// otherwise --skip-gh silently turns the DONE gate into a no-op. The
|
|
453
|
+
// unscoped corpus scan keeps the offline allowance, since a cold cache
|
|
454
|
+
// legitimately knows nothing about most scoped issues.
|
|
455
|
+
const unknownIsTerminal = !skipGh || issueFilter !== null;
|
|
456
|
+
if (state === "closed" || (state === null && unknownIsTerminal)) {
|
|
390
457
|
missing.push(entry);
|
|
391
458
|
}
|
|
392
459
|
}
|
|
@@ -13,6 +13,8 @@ import type { LiteralAcceptanceCommand, RejectedLiteralCommand } from "./types.j
|
|
|
13
13
|
export interface CaptureLiteralAcceptanceResult {
|
|
14
14
|
readonly commands: readonly LiteralAcceptanceCommand[];
|
|
15
15
|
readonly rejected: readonly RejectedLiteralCommand[];
|
|
16
|
+
/** Prompt lines skipped inside a transcript-shaped fence (#3511). */
|
|
17
|
+
readonly transcriptPromptSkipped: number;
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Capture literal acceptance commands from free-form task statement text.
|
|
@@ -47,6 +49,14 @@ export declare function captureAndAttachLiteralAcceptance(plan: Record<string, u
|
|
|
47
49
|
readonly commands: readonly LiteralAcceptanceCommand[];
|
|
48
50
|
readonly rejected: readonly RejectedLiteralCommand[];
|
|
49
51
|
};
|
|
52
|
+
/** True when a rejected ledger entry was scraped from narrative prose (#3484). */
|
|
53
|
+
export declare function isProseDerivedRejection(rejected: RejectedLiteralCommand): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* True when the author stated acceptance commands structurally — `swarm.verify_commands`
|
|
56
|
+
* or `plan.acceptance.commands` (#3484). Still used by intake/tests; demotion of
|
|
57
|
+
* prose-derived rejections no longer depends on this (#3511).
|
|
58
|
+
*/
|
|
59
|
+
export declare function hasStructuredAcceptanceCommands(plan: Record<string, unknown> | null | undefined): boolean;
|
|
50
60
|
/** Format rejected ledger for CLI / complete-gate messages. */
|
|
51
61
|
export declare function formatRejectedLedger(rejected: readonly RejectedLiteralCommand[]): string;
|
|
52
62
|
//# sourceMappingURL=capture.d.ts.map
|