ai-foreman 1.7.28 → 2.0.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/README.md +1 -1
- package/dist/adapters/claude.d.ts +23 -12
- package/dist/adapters/claude.js +228 -24
- package/dist/adapters/codex.d.ts +17 -7
- package/dist/adapters/codex.js +195 -17
- package/dist/adapters/recovering.d.ts +2 -0
- package/dist/adapters/recovering.js +5 -1
- package/dist/adapters/structured.d.ts +71 -0
- package/dist/adapters/structured.js +213 -0
- package/dist/adapters/types.d.ts +86 -9
- package/dist/agentRun.d.ts +2 -0
- package/dist/agentRun.js +2 -1
- package/dist/boundedTurnEvidence.d.ts +18 -0
- package/dist/boundedTurnEvidence.js +76 -0
- package/dist/branch/currentGuard.d.ts +2 -0
- package/dist/branch/currentGuard.js +2 -0
- package/dist/branch/planner.js +1 -4
- package/dist/branch/runner.d.ts +2 -1
- package/dist/branch/runner.js +10 -7
- package/dist/buildAdmission.js +4 -0
- package/dist/buildApproval.d.ts +30 -0
- package/dist/buildApproval.js +68 -0
- package/dist/buildAssignment.d.ts +1 -0
- package/dist/buildAssignment.js +82 -23
- package/dist/buildInterventions.d.ts +2 -2
- package/dist/buildInterventions.js +11 -4
- package/dist/buildLaunchGate.js +3 -2
- package/dist/builderGuidanceFollowup.js +17 -6
- package/dist/cli/manager.js +22 -20
- package/dist/cli/start.js +32 -24
- package/dist/cli/tickets.js +40 -24
- package/dist/continuity.d.ts +10 -14
- package/dist/continuity.js +198 -179
- package/dist/continuityOrigin.d.ts +13 -0
- package/dist/continuityOrigin.js +91 -0
- package/dist/foreman.d.ts +20 -5
- package/dist/foreman.js +57 -187
- package/dist/graph/boundary.d.ts +1 -1
- package/dist/graph/boundary.js +1 -1
- package/dist/graph/host.js +8 -19
- package/dist/graph/manager.d.ts +1 -1
- package/dist/graph/manager.js +1 -1
- package/dist/graph/preparation.d.ts +38 -0
- package/dist/graph/preparation.js +7 -6
- package/dist/graph/semantic.d.ts +1 -0
- package/dist/graph/semantic.js +4 -1
- package/dist/graph/session.js +7 -2
- package/dist/graph/turn.d.ts +2 -3
- package/dist/graph/turn.js +28 -40
- package/dist/handoffProtocol.js +2 -2
- package/dist/handoffs.d.ts +3 -1
- package/dist/handoffs.js +90 -59
- package/dist/hostGraphApplicability.d.ts +46 -0
- package/dist/hostGraphApplicability.js +97 -0
- package/dist/hostQaAugmentation.d.ts +18 -0
- package/dist/hostQaAugmentation.js +81 -0
- package/dist/hostQaComparison.d.ts +21 -2
- package/dist/hostQaComparison.js +43 -28
- package/dist/hostSourcePreservation.d.ts +38 -0
- package/dist/hostSourcePreservation.js +72 -0
- package/dist/interviews.d.ts +7 -0
- package/dist/interviews.js +18 -1
- package/dist/legacyCommunicationDisplay.d.ts +2 -0
- package/dist/legacyCommunicationDisplay.js +2 -0
- package/dist/managerPacket.js +3 -3
- package/dist/markers.d.ts +4 -3
- package/dist/markers.js +4 -20
- package/dist/probeIpc.d.ts +14 -0
- package/dist/probeIpc.js +29 -0
- package/dist/qaBuildGate.d.ts +21 -0
- package/dist/qaBuildGate.js +48 -12
- package/dist/qaBuilderCoverage.js +22 -13
- package/dist/qaBuilderEvidence.d.ts +16 -1
- package/dist/qaBuilderEvidence.js +48 -8
- package/dist/qaContractCoverage.d.ts +2 -2
- package/dist/qaContractCoverage.js +11 -7
- package/dist/qaContractDelivery.js +34 -20
- package/dist/qaCoverageAssembly.d.ts +22 -0
- package/dist/qaCoverageAssembly.js +16 -0
- package/dist/qaDeliveryJournal.d.ts +2 -0
- package/dist/qaDeliveryJournal.js +19 -0
- package/dist/qaEffectiveConfig.d.ts +1 -0
- package/dist/qaEffectiveConfig.js +6 -1
- package/dist/qaFailureDelivery.js +97 -85
- package/dist/qaHostTransformation.d.ts +26 -0
- package/dist/qaHostTransformation.js +100 -0
- package/dist/qaPreparation.d.ts +8 -20
- package/dist/qaPreparation.js +133 -229
- package/dist/qaPreparationInputs.js +19 -0
- package/dist/qaPreparationStore.js +34 -6
- package/dist/qaPrerequisites.d.ts +2 -1
- package/dist/qaPrerequisites.js +21 -1
- package/dist/qaProtocolV2.d.ts +15 -0
- package/dist/qaRecovery.js +21 -4
- package/dist/qaReview.js +232 -394
- package/dist/qaReviewEvidence.d.ts +7 -3
- package/dist/qaReviewEvidence.js +15 -4
- package/dist/qaRuntime.js +1 -1
- package/dist/qaSnapshot.js +71 -21
- package/dist/qaStructuredResponse.d.ts +10 -0
- package/dist/qaStructuredResponse.js +57 -0
- package/dist/qaTimeline.js +5 -3
- package/dist/qaToolRecovery.d.ts +12 -0
- package/dist/qaToolRecovery.js +44 -0
- package/dist/qaVerificationContract.d.ts +3 -2
- package/dist/qaVerificationContract.js +58 -34
- package/dist/readinessGate.js +5 -4
- package/dist/runtimeReadiness.js +23 -15
- package/dist/statusReporter.d.ts +2 -0
- package/dist/statusReporter.js +2 -0
- package/dist/structuredCutover.d.ts +31 -0
- package/dist/structuredCutover.js +510 -0
- package/dist/structuredCutoverFiles.d.ts +10 -0
- package/dist/structuredCutoverFiles.js +181 -0
- package/dist/structuredDispatchAuthority.d.ts +22 -0
- package/dist/structuredDispatchAuthority.js +110 -0
- package/dist/structuredDispatchRecord.d.ts +29 -0
- package/dist/structuredDispatchRecord.js +36 -0
- package/dist/structuredLiveBudget.d.ts +2 -0
- package/dist/structuredLiveBudget.js +23 -0
- package/dist/structuredOperation.d.ts +18 -0
- package/dist/structuredOperation.js +257 -0
- package/dist/supervisedStart.d.ts +1 -1
- package/dist/supervisedStart.js +78 -31
- package/dist/supervisor.d.ts +18 -2
- package/dist/supervisor.js +74 -17
- package/dist/ticketPlanning.d.ts +1 -373
- package/dist/ticketPlanning.js +2 -26
- package/dist/ticketPopulation.d.ts +0 -3
- package/dist/ticketPopulation.js +4 -21
- package/dist/ticketPopulationPageAuthority.d.ts +13 -0
- package/dist/ticketPopulationPageAuthority.js +30 -0
- package/dist/ticketPopulationPaging.d.ts +27 -0
- package/dist/ticketPopulationPaging.js +105 -0
- package/dist/tickets/renderMarkdown.d.ts +14 -0
- package/dist/tickets/renderMarkdown.js +39 -5
- package/dist/tickets/ticketLoader.js +10 -0
- package/dist/tickets/ticketSchema.d.ts +107 -0
- package/dist/tickets/ticketSchema.js +4 -1
- package/dist/workflowDb.d.ts +100 -2
- package/dist/workflowDb.js +781 -35
- package/dist/workflowReader.d.ts +1 -0
- package/dist/workflowReader.js +9 -0
- package/package.json +15 -7
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type QaHostTransformationRule = "assessment-host-bindings-v1" | "depth-host-bindings-v1" | "draft-host-bindings-v1";
|
|
2
|
+
export interface QaHostTransformationV1 {
|
|
3
|
+
version: 1;
|
|
4
|
+
ruleVersion: QaHostTransformationRule;
|
|
5
|
+
operation: string;
|
|
6
|
+
tupleDigest: string;
|
|
7
|
+
inputDigest: string;
|
|
8
|
+
outputDigest: string;
|
|
9
|
+
authorityClass: "host-binding-and-observation";
|
|
10
|
+
justification: string;
|
|
11
|
+
effects: Array<{
|
|
12
|
+
path: string;
|
|
13
|
+
beforeDigest: string;
|
|
14
|
+
afterDigest: string;
|
|
15
|
+
}>;
|
|
16
|
+
}
|
|
17
|
+
/** Records only approved host effects; provider/user requirements remain immutable. */
|
|
18
|
+
export declare function qaHostTransformation(input: {
|
|
19
|
+
rule: QaHostTransformationRule;
|
|
20
|
+
operation: string;
|
|
21
|
+
tupleDigest: string;
|
|
22
|
+
before: unknown;
|
|
23
|
+
after: unknown;
|
|
24
|
+
workspacePaths?: Record<string, string>;
|
|
25
|
+
}): QaHostTransformationV1;
|
|
26
|
+
export declare function verifyQaHostTransformation(record: QaHostTransformationV1, before: unknown, after: unknown, workspacePaths?: Record<string, string>): void;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { canonicalJson, structuredDigest } from "rafi-spec";
|
|
2
|
+
const hashValue = (value, present) => structuredDigest({ present, ...(present ? { value } : {}) });
|
|
3
|
+
/** Records only approved host effects; provider/user requirements remain immutable. */
|
|
4
|
+
export function qaHostTransformation(input) {
|
|
5
|
+
if (!["assessment-host-bindings-v1", "depth-host-bindings-v1", "draft-host-bindings-v1"].includes(input.rule))
|
|
6
|
+
throw new Error("Unknown QA host transformation rule");
|
|
7
|
+
if (!/^[a-f0-9]{64}$/.test(input.tupleDigest) || !input.operation)
|
|
8
|
+
throw new Error("QA transformation requires native tuple provenance");
|
|
9
|
+
const effects = [];
|
|
10
|
+
const original = input.before, transformed = input.after;
|
|
11
|
+
const ids = new Map();
|
|
12
|
+
if (input.rule === "draft-host-bindings-v1") {
|
|
13
|
+
if (transformed.checks.length < original.checks.length)
|
|
14
|
+
throw new Error("QA transformation cannot remove provider checks");
|
|
15
|
+
original.checks.forEach((check, index) => ids.set(check.id, transformed.checks[index].id));
|
|
16
|
+
}
|
|
17
|
+
const labelIds = [...ids.keys()].filter(id => id.startsWith("check-")).sort((a, b) => b.length - a.length);
|
|
18
|
+
const labelPattern = labelIds.length ? new RegExp(`(^|[^A-Za-z0-9_-])(${labelIds.map(id => id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})(?![A-Za-z0-9_-])`, "g") : undefined;
|
|
19
|
+
const relabel = (value) => typeof value === "string" && labelPattern
|
|
20
|
+
? value.replace(labelPattern, (_match, prefix, id) => `${prefix}${ids.get(id)}`) : value;
|
|
21
|
+
const walk = (before, after, path, beforePresent = true, afterPresent = true) => {
|
|
22
|
+
if (beforePresent === afterPresent && canonicalJson(before ?? null) === canonicalJson(after ?? null))
|
|
23
|
+
return;
|
|
24
|
+
if (input.rule === "draft-host-bindings-v1" && path === "baseline" && Array.isArray(before) && Array.isArray(after)) {
|
|
25
|
+
for (const prior of before)
|
|
26
|
+
if (!after.some(row => row.id === prior.id))
|
|
27
|
+
throw new Error("QA transformation cannot remove provider observations");
|
|
28
|
+
for (const [index, row] of after.entries()) {
|
|
29
|
+
const prior = before.find(item => item.id === row.id);
|
|
30
|
+
walk(prior, row, `baseline.${index}`, prior !== undefined, true);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (before && after && typeof before === "object" && typeof after === "object" && Array.isArray(before) === Array.isArray(after)) {
|
|
35
|
+
for (const key of [...new Set([...Object.keys(before), ...Object.keys(after)])].sort())
|
|
36
|
+
walk(before[key], after[key], path ? `${path}.${key}` : key, Object.hasOwn(before, key), Object.hasOwn(after, key));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const assessment = /^(draftPayloadDigest|inventoryDigest|policyVersion|authorSessionId|sessionId|operationId)$/.test(path);
|
|
40
|
+
const depth = /^(plannerOperationId|plannerIdentity|minimumReasons(?:\.\d+)?)$/.test(path);
|
|
41
|
+
let draft = false;
|
|
42
|
+
if (input.rule === "draft-host-bindings-v1") {
|
|
43
|
+
const check = /^checks\.(\d+)\.(.+)$/.exec(path);
|
|
44
|
+
const originalCheck = check && original.checks[Number(check[1])];
|
|
45
|
+
const idReference = /^(checks\.\d+\.(id|dependsOnChecks\.\d+)|coverage\.\d+\.checkIds\.\d+|unresolved\.\d+\.checkIds\.\d+)$/.test(path);
|
|
46
|
+
draft = idReference && ids.get(before) === after;
|
|
47
|
+
if (check?.[2] === "obligation" && originalCheck && after === "mandatory") {
|
|
48
|
+
draft = original.requirements.some((requirement) => requirement.obligation === "mandatory" &&
|
|
49
|
+
original.coverage.some((row) => row.requirementId === requirement.id && row.checkIds.includes(originalCheck.id)));
|
|
50
|
+
}
|
|
51
|
+
if (check && /^requirementRefs\.\d+$/.test(check[2]) && !beforePresent && originalCheck) {
|
|
52
|
+
draft = original.coverage.some((row) => row.requirementId === after && row.checkIds.includes(originalCheck.id));
|
|
53
|
+
}
|
|
54
|
+
if (/^checks\.\d+\.hostKind$/.test(path) && !beforePresent)
|
|
55
|
+
draft = after === "source-scope" || after === "graph-maintenance";
|
|
56
|
+
if (/^checks\.\d+$/.test(path) && !beforePresent)
|
|
57
|
+
draft = after && (after.hostKind === "source-scope" || after.hostKind === "graph-maintenance") &&
|
|
58
|
+
after.origin === "invariant" && after.obligation === "mandatory" && after.requirementRefs.every((id) => original.requirements.some((requirement) => requirement.id === id));
|
|
59
|
+
if (/^baseline\.\d+$/.test(path) && !beforePresent)
|
|
60
|
+
draft = after && /^[a-f0-9]{64}$/.test(after.evidenceDigest) && typeof after.observedAt === "string";
|
|
61
|
+
if (/^baseline\.\d+\.(sourceDigest|observedAt|phase|evidenceDigest)$/.test(path))
|
|
62
|
+
draft = true;
|
|
63
|
+
if (/^baseline\.\d+\.checkId$/.test(path)) {
|
|
64
|
+
const row = transformed.baseline[Number(path.split(".")[1])];
|
|
65
|
+
const checks = transformed.checks.filter((item) => item.prerequisiteRefs.includes(row.id));
|
|
66
|
+
draft = ids.get(before) === after || checks.length === 1 && checks[0].id === after;
|
|
67
|
+
}
|
|
68
|
+
if (/^preparationEvidence\.\d+\.(operationId|sessionId|graphReceiptRefs(?:\.\d+)?|evidenceDigest)$/.test(path) ||
|
|
69
|
+
/^preparationEvidence\.\d+\.references\.\d+\.digest$/.test(path))
|
|
70
|
+
draft = true;
|
|
71
|
+
if (/^(checks\.\d+\.verification\.\d+\.cwd|preparationEvidence\.\d+\.references\.\d+\.path)$/.test(path))
|
|
72
|
+
draft = typeof before === "string" && input.workspacePaths?.[before] === after;
|
|
73
|
+
// The only permitted prose edit substitutes exact provider check identifiers.
|
|
74
|
+
if (/^(checks\.\d+\.(expectedBehavior|expectedEvidence\.\d+|expectedBaseline|applicability\.(predicate|requiredEvidence\.\d+)|verification\.\d+\.(expectedOutcome|steps\.\d+))|baseline\.\d+\.(procedure|relevance|expectedTransition|predicateEvidence\.\d+)|preparationEvidence\.\d+\.analysis|unresolved\.\d+\.(reason|nextAction))$/.test(path) &&
|
|
75
|
+
typeof before === "string" && before !== after && relabel(before) === after)
|
|
76
|
+
draft = true;
|
|
77
|
+
}
|
|
78
|
+
if (!(input.rule === "assessment-host-bindings-v1" ? assessment : input.rule === "depth-host-bindings-v1" ? depth : draft))
|
|
79
|
+
throw new Error(`QA host transformation cannot change provider requirements or semantic fields: ${path}`);
|
|
80
|
+
effects.push({ path, beforeDigest: hashValue(before, beforePresent), afterDigest: hashValue(after, afterPresent) });
|
|
81
|
+
if (effects.length > 10000)
|
|
82
|
+
throw new Error("QA host transformation exceeds effect budget");
|
|
83
|
+
};
|
|
84
|
+
walk(input.before, input.after, "");
|
|
85
|
+
if (input.rule === "depth-host-bindings-v1") {
|
|
86
|
+
const before = input.before;
|
|
87
|
+
const after = input.after;
|
|
88
|
+
const expected = [...before.minimumReasons, ...before.riskFactors.map(risk => risk.category).filter(category => !before.minimumReasons.includes(category))];
|
|
89
|
+
if (canonicalJson(expected) !== canonicalJson(after.minimumReasons))
|
|
90
|
+
throw new Error("Depth labels must be exactly derivable from provider risk factors");
|
|
91
|
+
}
|
|
92
|
+
return { version: 1, ruleVersion: input.rule, operation: input.operation, tupleDigest: input.tupleDigest,
|
|
93
|
+
inputDigest: structuredDigest(input.before), outputDigest: structuredDigest(input.after), effects,
|
|
94
|
+
authorityClass: "host-binding-and-observation", justification: "Bind native dispatch identities and retained host observations; preserve provider/user requirements" };
|
|
95
|
+
}
|
|
96
|
+
export function verifyQaHostTransformation(record, before, after, workspacePaths) {
|
|
97
|
+
const expected = qaHostTransformation({ rule: record.ruleVersion, operation: record.operation, tupleDigest: record.tupleDigest, before, after, workspacePaths });
|
|
98
|
+
if (canonicalJson(expected) !== canonicalJson(record))
|
|
99
|
+
throw new Error("QA host transformation replay mismatch");
|
|
100
|
+
}
|
package/dist/qaPreparation.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { type OutputContract, type SelectedDispatchTupleV2, type StructuredResponse } from "rafi-spec";
|
|
1
2
|
import type { QaContractCandidateV1, QaSemanticAssessmentV1, RequirementRef, QaVerificationContractV1 } from "rafi-spec";
|
|
2
3
|
import type { QaPreparationStore, LogicalPreparationBudget } from "./qaPreparationStore.js";
|
|
4
|
+
/** Compatibility re-exports; canonical contract ownership is rafi-spec. */
|
|
5
|
+
export { draftOutput, assessmentOutput, challengeOutput, depthOutput } from "rafi-spec";
|
|
3
6
|
export interface PreparationProviderResult {
|
|
7
|
+
output?: OutputContract;
|
|
8
|
+
structured?: StructuredResponse;
|
|
9
|
+
selectedDispatch?: SelectedDispatchTupleV2;
|
|
4
10
|
operationId?: string;
|
|
5
11
|
text: string;
|
|
6
12
|
sessionId: string;
|
|
@@ -14,7 +20,7 @@ export interface PreparationDependencies {
|
|
|
14
20
|
/** Provider-specific wording is allowed; contract ownership is not. */
|
|
15
21
|
provider?: "claude" | "codex";
|
|
16
22
|
/** Each dispatch is a fresh, confined conversation, with a persisted reservation. */
|
|
17
|
-
dispatch(phase: "planner" | "prepare" | "assess" | "challenge" | "repair", instruction: string, operationId: string, remainingMs: number): Promise<PreparationProviderResult>;
|
|
23
|
+
dispatch(phase: "planner" | "prepare" | "assess" | "challenge" | "repair", instruction: string, operationId: string, remainingMs: number, output: OutputContract): Promise<PreparationProviderResult>;
|
|
18
24
|
inputsCurrent(candidate: QaContractCandidateV1): boolean;
|
|
19
25
|
normalizeDraft?(draft: QaContractCandidateV1, response: PreparationProviderResult): QaContractCandidateV1;
|
|
20
26
|
hostFacts?: string;
|
|
@@ -29,22 +35,11 @@ export type PreparationOutcome = {
|
|
|
29
35
|
};
|
|
30
36
|
export declare const FILE_SCOPE_GUIDANCE = "File lists in plans and tickets, including likely_files and generated file-only diff expectations, are estimates of implementation, not exhaustive boundaries. Different named files or an extra relevant file do not by themselves create a material conflict or block the build. Retain and assess every original requirement; for file-list checks verify that changes serve the approved work rather than requiring an exact file list or a pre-edit snapshot proving no other files changed. Rafi owns tracker lifecycle updates. Generated instructions to mark a ticket done in a document are bookkeeping, not a Builder acceptance criterion or a material conflict; do not require the Builder to perform them, and do not require the host to amend the plan before building. Do not disregard explicit user-established security, privacy, access, or other safety restrictions, or expand the approved product functionality. Report genuine substantive or safety conflicts.";
|
|
31
37
|
export declare const ROLLBACK_VERIFICATION_GUIDANCE = "When an original requirement explicitly asks to verify that rollback restores behavior, specify concrete future verification evidence rather than only inspecting rollback prose. A rollback plan alone does not require a rollback execution or mutation-testing rehearsal. For an npm test project where current uncommitted product changes represent the change to rehearse, the Builder may run rafi qa-rehearse-rollback alone from the project root; it runs npm test before and after reverting a synthetic commit of all uncommitted product changes in an independent temporary repository. It also runs git diff --exit-code against the captured pre-change HEAD after the revert and tests; success proves the tracked files match that baseline. For a requirement that a particular string be absent after rollback, inspecting its absence in the captured baseline plus that successful whole-tree comparison is concrete evidence of absence in the reverted tracked file. The rehearsal cannot use installed dependencies or symbolic links and does not prove ticket isolation or that an actual existing ticket commit was reverted. Assess whether this evidence satisfies the original requirement; do not claim it does when the original explicitly requires the actual ticket commit. Do not assume copying files to external scratch, arbitrary scripts or mutation experiments are allowed. If actual rollback execution is explicitly required but no permitted method satisfies it, report the limitation. Never perform destructive rollback in the source workspace or claim a rehearsal has already happened.";
|
|
32
|
-
export declare const EXECUTABLE_CHECK_GUIDANCE = "Choose verification procedures compatible with the Builder's project permissions and workspace. Documentation is disabled unless the host-bound contract documentation.required is true. When it is false, do not invent documentation checks merely because a docs directory or API-looking path exists; an absent documentation surface is not a failure. When it is true, use only the contract's exact targets and criteria, and define an actionable absent-target outcome. Do not invent mandatory inline node -e or node --eval commands: the Builder policy may refuse them. For a JavaScript behavior or export check, prefer a project-local test file executed with the project's existing test command, or a permitted node --test invocation. Do not invent a mandatory test-first RED phase or other historical sequence merely because a plan requires tests before and after implementation: a passing baseline test is not a failing new test. When an original requirement actually requires a historical sequence, preserve it and specify concrete independently reviewable evidence paths or retained host events for each required step; a generic statement that sequencing evidence exists is not actionable, and a later passing test does not prove past events. If the project policy makes raw stdout redirection or scratch-log creation unavailable, do not turn log-file capture into a blocker: use the retained bounded tool output and host events instead, and never cite a scratch path unless that exact file was successfully created and inspected. The independent QA snapshot may have a detached HEAD even when the Builder source workspace is on a branch; do not use its branch name to infer the Builder source branch. Diff and scope checks must compare the current snapshot with the captured pre-implementation baseline, not blindly with repository HEAD: previously approved or completed ticket changes are part of that baseline and must not be reported as new work. A scope check must first enumerate every changed path outside the explicit bookkeeping/evidence exclusions, then compare that complete host-observed set with the approved product/ticket scope; do not pre-filter the list to expected filenames, because that would hide accidental extra product edits. Bounded evidence-only paths such as scratch/ are not product scope and must be excluded from product-path scope checks while their retained evidence remains subject to QA review. For a current-branch multi-ticket build, do not invent a mandatory branch-alone execution check merely to prove ticket independence; use baseline-aware source/test inspection and the permitted project tests unless the original requirement explicitly requires an actual isolated execution. For additive tickets in a current-branch multi-ticket build, \u201Cacceptable on its own\u201D is satisfied by showing that each ticket's own tests import and exercise only its own feature, pass with the shared baseline and required project tests, and do not depend on the sibling feature; do not require removing another additive feature or perform a destructive rollback experiment unless the approved requirement explicitly requires absence testing or an isolated branch. Preserve explicitly requested procedures and substantive requirements; if a required procedure cannot be run, identify the limitation rather than claiming it was executed. Independently assess whether proposed evidence actually tests the required behavior.";
|
|
38
|
+
export declare const EXECUTABLE_CHECK_GUIDANCE = "Choose verification procedures compatible with the Builder's project permissions and workspace. Keep applicability and verification instructions consistent: an unconditional check must always be reported applicable, including a check whose predicate confirms an absent feature, disabled documentation, or an unrequested skill. For such a check require passed evidence of the absence, never an instruction to report the check not-applicable. If execution itself depends on a condition, encode conditional applicability with a concrete predicate and evidence. The independent assessor must flag contradictory applicability instructions before readiness. Documentation is disabled unless the host-bound contract documentation.required is true. When it is false, do not invent documentation checks merely because a docs directory or API-looking path exists; an absent documentation surface is not a failure. When it is true, use only the contract's exact targets and criteria, and define an actionable absent-target outcome. Do not invent mandatory inline node -e or node --eval commands: the Builder policy may refuse them. For a JavaScript behavior or export check, prefer a project-local test file executed with the project's existing test command, or a permitted node --test invocation. Do not invent a mandatory test-first RED phase or other historical sequence merely because a plan requires tests before and after implementation: a passing baseline test is not a failing new test. When an original requirement actually requires a historical sequence, preserve it and specify concrete independently reviewable evidence paths or retained host events for each required step; a generic statement that sequencing evidence exists is not actionable, and a later passing test does not prove past events. If the project policy makes raw stdout redirection or scratch-log creation unavailable, do not turn log-file capture into a blocker: use the retained bounded tool output and host events instead, and never cite a scratch path unless that exact file was successfully created and inspected. The independent QA snapshot may have a detached HEAD even when the Builder source workspace is on a branch; do not use its branch name to infer the Builder source branch. Diff and scope checks must compare the current snapshot with the captured pre-implementation baseline, not blindly with repository HEAD: previously approved or completed ticket changes are part of that baseline and must not be reported as new work. A scope check must first enumerate every changed path outside the explicit bookkeeping/evidence exclusions, then compare that complete host-observed set with the approved product/ticket scope; do not pre-filter the list to expected filenames, because that would hide accidental extra product edits. Bounded evidence-only paths such as scratch/ are not product scope and must be excluded from product-path scope checks while their retained evidence remains subject to QA review. For a current-branch multi-ticket build, do not invent a mandatory branch-alone execution check merely to prove ticket independence; use baseline-aware source/test inspection and the permitted project tests unless the original requirement explicitly requires an actual isolated execution. For additive tickets in a current-branch multi-ticket build, \u201Cacceptable on its own\u201D is satisfied by showing that each ticket's own tests import and exercise only its own feature, pass with the shared baseline and required project tests, and do not depend on the sibling feature; do not require removing another additive feature or perform a destructive rollback experiment unless the approved requirement explicitly requires absence testing or an isolated branch. Preserve explicitly requested procedures and substantive requirements; if a required procedure cannot be run, identify the limitation rather than claiming it was executed. Independently assess whether proposed evidence actually tests the required behavior.";
|
|
33
39
|
/** Baseline bookkeeping must not block ordinary approved implementation work. */
|
|
34
40
|
export declare const APPROVED_PATH_BASELINE_GUIDANCE = "Baseline membership is host-owned bookkeeping, not a Builder requirement. An approved product path, export, or test file is not a material QA concern merely because the provider cannot prove whether it was present before implementation. Do not reconstruct or disclose the full baseline, and do not turn that uncertainty into an unresolved concern. Rafi performs the exact host comparison. Do not author a provider-executed check that asks for Rafi's host postimplementation path manifest, complete changed-path inventory, or unchanged-file comparison; that host-owned comparison is already performed outside the provider snapshot and must be represented by the retained host observation, not by raw manifest disclosure or a provider check. For current-branch additive tickets, a provider-authored or inferred request to test the branch with an already-completed sibling feature removed is not an applicable requirement when the approved scope says not to remove or reconstruct that sibling; verify the ticket's own behavior and tests against the shared baseline instead. Treat sibling-absence testing as binding only when the user explicitly approved that absence requirement. Escalate only an actual host-observed out-of-scope, destructive, protected-file, or requirement-relevant change.";
|
|
35
41
|
/** Ignore known non-authoritative annotations; the original provider response remains retained. */
|
|
36
42
|
export declare function normalizeAssessmentMetadata<T extends QaSemanticAssessmentV1>(assessment: T): T;
|
|
37
|
-
/** Accept only an exact known obligation label when a provider wraps it in a
|
|
38
|
-
* descriptive object. This is a representation repair, not a host decision:
|
|
39
|
-
* unknown or ambiguous objects remain unchanged and fail schema validation. */
|
|
40
|
-
export declare function normalizeAssessmentObligations<T extends QaSemanticAssessmentV1>(assessment: T, allowed: string[]): T;
|
|
41
|
-
/** A preparation assessor must not block on the expected absence of future
|
|
42
|
-
* Builder work. Keep the concern for auditability, but make it non-material
|
|
43
|
-
* only when every referenced check is postimplementation and the concern is
|
|
44
|
-
* explicitly asking the Builder to implement/rerun that check. Concerns tied
|
|
45
|
-
* to preimplementation checks, missing procedures, or other semantic gaps
|
|
46
|
-
* remain blocking. */
|
|
47
|
-
export declare function normalizeExpectedFutureAssessment<T extends QaSemanticAssessmentV1>(assessment: T, candidate: QaContractCandidateV1): T;
|
|
48
43
|
/**
|
|
49
44
|
* A mandatory requirement must have at least one mandatory verification check.
|
|
50
45
|
* Providers occasionally return a concrete check with the weaker advisory
|
|
@@ -53,11 +48,4 @@ export declare function normalizeExpectedFutureAssessment<T extends QaSemanticAs
|
|
|
53
48
|
* enforce readiness and independent-QA requirements for the promoted check.
|
|
54
49
|
*/
|
|
55
50
|
export declare function enforceMandatoryCoverage(candidate: QaContractCandidateV1): QaContractCandidateV1;
|
|
56
|
-
/**
|
|
57
|
-
* Codex occasionally appends a made-up requirement ID to an otherwise valid
|
|
58
|
-
* check. Remove only those extraneous annotations when the check still has an
|
|
59
|
-
* exact authoritative reference. Never invent or remap an ID, and leave a
|
|
60
|
-
* check with no valid references untouched so normal validation fails closed.
|
|
61
|
-
*/
|
|
62
|
-
export declare function removeExtraneousRequirementReferences(candidate: QaContractCandidateV1, inventory: RequirementRef[]): QaContractCandidateV1;
|
|
63
51
|
export declare function prepareVerificationContract(initial: QaContractCandidateV1, inventory: RequirementRef[], deps: PreparationDependencies): Promise<PreparationOutcome>;
|