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
package/dist/workflowDb.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type CheckpointOrigin } from "./continuityOrigin.js";
|
|
2
|
+
import { type SealedDispatchRecordV2 } from "./structuredDispatchRecord.js";
|
|
1
3
|
import { type GraphDerivedAccess } from "./graph/derived.js";
|
|
2
4
|
import { QaPreparationStore } from "./qaPreparationStore.js";
|
|
3
5
|
import { GraphStore } from "./graph/storage.js";
|
|
@@ -84,6 +86,10 @@ export interface RoleMutationLease {
|
|
|
84
86
|
sessionKey?: string;
|
|
85
87
|
movedAt: string;
|
|
86
88
|
}
|
|
89
|
+
export interface FreshRecoveryValidation {
|
|
90
|
+
decisionDigest: string;
|
|
91
|
+
predecessor: RoleMutationLease;
|
|
92
|
+
}
|
|
87
93
|
export interface QaRecoveryHeadRecord {
|
|
88
94
|
runId: string;
|
|
89
95
|
ticketId: string;
|
|
@@ -235,8 +241,8 @@ export declare class WorkflowDb {
|
|
|
235
241
|
text: string;
|
|
236
242
|
ids: string[];
|
|
237
243
|
};
|
|
238
|
-
verifyBuilderGuidance(ids: string[], certificate: Parameters<typeof verifyBuilderGuidance>[2], response: string, receiptDigest: string): void;
|
|
239
|
-
verifyGuidance(ids: string[], certificate: Parameters<typeof verifyGuidance>[2], response: string): void;
|
|
244
|
+
verifyBuilderGuidance(ids: string[], certificate: Parameters<typeof verifyBuilderGuidance>[2], response: string | readonly string[], receiptDigest: string): void;
|
|
245
|
+
verifyGuidance(ids: string[], certificate: Parameters<typeof verifyGuidance>[2], response: string | readonly string[]): void;
|
|
240
246
|
hasQueuedBuilderGuidance(runId: string, workId: string): boolean;
|
|
241
247
|
instruction(id: string): import("./buildInterventions.js").BuildInstruction | undefined;
|
|
242
248
|
assertFinalizationControls(runId: string, workId: string): void;
|
|
@@ -368,6 +374,7 @@ export declare class WorkflowDb {
|
|
|
368
374
|
sessionKey?: string;
|
|
369
375
|
}, now?: Date): ContinuityEvent;
|
|
370
376
|
continuityEvents(runId: string, afterSequence?: number): ContinuityEvent[];
|
|
377
|
+
providerCheckpoint(dispatchId: string, publicationKind: string): ContinuityCheckpoint | undefined;
|
|
371
378
|
publishContinuityCheckpoint(input: {
|
|
372
379
|
runId: string;
|
|
373
380
|
role: "builder" | "qa";
|
|
@@ -376,6 +383,9 @@ export declare class WorkflowDb {
|
|
|
376
383
|
authoritativeStateRevision: number;
|
|
377
384
|
sessionRef?: ProviderSessionRefV1;
|
|
378
385
|
sessionKey?: string;
|
|
386
|
+
origin?: CheckpointOrigin;
|
|
387
|
+
hostEventKind?: "role-baseline" | "operator-recovery" | "source-reconciliation";
|
|
388
|
+
inputCheckpointDigests?: string[];
|
|
379
389
|
}, now?: Date): ContinuityCheckpoint;
|
|
380
390
|
continuityCheckpoints(runId: string, role?: "builder" | "qa"): ContinuityCheckpoint[];
|
|
381
391
|
latestContinuityCheckpoint(runId: string, role: "builder" | "qa"): ContinuityCheckpoint | undefined;
|
|
@@ -428,6 +438,41 @@ export declare class WorkflowDb {
|
|
|
428
438
|
kind: string;
|
|
429
439
|
intent: unknown;
|
|
430
440
|
}, now?: Date): OperationRecord;
|
|
441
|
+
/** Seal a previously persisted non-authoritative preparation intent. This
|
|
442
|
+
* is intentionally legal only before provider content dispatch begins. */
|
|
443
|
+
sealPlannedOperationIntent(idempotencyKey: string, intent: unknown, now?: Date): OperationRecord;
|
|
444
|
+
/** Called in the gateway's sealing transaction, before the send capability exists. */
|
|
445
|
+
sealStructuredOwnerDispatch(key: string, tuple: import("rafi-spec").SelectedDispatchTupleV2, renderedInstruction: string): void;
|
|
446
|
+
structuredOwnerDispatch(key: string): SealedDispatchRecordV2;
|
|
447
|
+
assertStructuredDispatchAdmission(runId: string, dispatchId: string, parentId: string | undefined, operation: string): void;
|
|
448
|
+
beginStructuredHandoff(predecessorId: string): void;
|
|
449
|
+
linkStructuredHandoffDispatch(dispatchId: string, parentId: string | undefined, operation: string): void;
|
|
450
|
+
planStructuredContinuation(predecessorId: string, successor: ProviderSessionRefV1): string;
|
|
451
|
+
structuredContinuation(runId: string, role: "builder" | "qa"): {
|
|
452
|
+
predecessorId: string;
|
|
453
|
+
continuationId: string;
|
|
454
|
+
state: string;
|
|
455
|
+
successor: ProviderSessionRefV1;
|
|
456
|
+
} | undefined;
|
|
457
|
+
finishStructuredContinuation(dispatchId: string): void;
|
|
458
|
+
private assertAcceptedStructuredSuccessor;
|
|
459
|
+
requireStructuredPostprocessing(dispatchId: string, context: unknown): void;
|
|
460
|
+
structuredProcessingContext(dispatchId: string): {
|
|
461
|
+
instruction: string;
|
|
462
|
+
policy: import("./adapters/types.js").TurnRequest;
|
|
463
|
+
};
|
|
464
|
+
failStructuredPostprocessing(dispatchId: string, error: string): void;
|
|
465
|
+
completeStructuredPostprocessing(dispatchId: string): void;
|
|
466
|
+
pendingStructuredPostprocessing(runId: string): string[];
|
|
467
|
+
retainedStructuredTurn(dispatchId: string): import("./adapters/types.js").TurnResult;
|
|
468
|
+
/** A claim is never recycled, even if transport fails before writing bytes. */
|
|
469
|
+
claimStructuredSubmission(tuple: import("rafi-spec").SelectedDispatchTupleV2, session?: ProviderSessionRefV1): string;
|
|
470
|
+
consumeStructuredSubmission(tuple: import("rafi-spec").SelectedDispatchTupleV2, claimId: string, session?: ProviderSessionRefV1): void;
|
|
471
|
+
assertNativeRunAdmission(runId: string): void;
|
|
472
|
+
recordCommunicationEvidenceRefs(ownerId: string, digests: string[]): void;
|
|
473
|
+
replayStructuredDispatch<T>(key: string, contract: import("rafi-spec").OutputContract<T>): T;
|
|
474
|
+
private assertStructuredProviderTurn;
|
|
475
|
+
private verifyRetainedStructuredDispatch;
|
|
431
476
|
updateOperation(idempotencyKey: string, status: OperationLifecycle, details?: {
|
|
432
477
|
result?: unknown;
|
|
433
478
|
externalId?: string;
|
|
@@ -438,6 +483,38 @@ export declare class WorkflowDb {
|
|
|
438
483
|
operation(idempotencyKey: string): OperationRecord | undefined;
|
|
439
484
|
operations(runId: string): OperationRecord[];
|
|
440
485
|
putEvidence(kind: "handoff" | "diff" | "test" | "qa", value: string | Buffer, now?: Date): string;
|
|
486
|
+
/** Create an append-only provider page artifact before its first dispatch. */
|
|
487
|
+
populationPageRecords(artifactId: string): string[];
|
|
488
|
+
populationPageLedger(artifactId: string): {
|
|
489
|
+
tupleDigest: string;
|
|
490
|
+
state: string;
|
|
491
|
+
pageCount: number;
|
|
492
|
+
} | undefined;
|
|
493
|
+
beginPageLedger(input: {
|
|
494
|
+
artifactId: string;
|
|
495
|
+
runId: string;
|
|
496
|
+
lineageId: string;
|
|
497
|
+
tupleDigest: string;
|
|
498
|
+
leaseId: string;
|
|
499
|
+
}, now?: Date): void;
|
|
500
|
+
/**
|
|
501
|
+
* Atomically appends a page. Duplicate delivery is accepted only when every
|
|
502
|
+
* immutable byte and linkage field agrees; a provider cannot fill gaps,
|
|
503
|
+
* rewrite history, or append after the terminal page.
|
|
504
|
+
*/
|
|
505
|
+
appendPageLedger(input: {
|
|
506
|
+
artifactId: string;
|
|
507
|
+
lineageId: string;
|
|
508
|
+
tupleDigest: string;
|
|
509
|
+
leaseId: string;
|
|
510
|
+
ordinal: number;
|
|
511
|
+
predecessorDigest: string | null;
|
|
512
|
+
content: string;
|
|
513
|
+
terminal: boolean;
|
|
514
|
+
}, now?: Date): {
|
|
515
|
+
digest: string;
|
|
516
|
+
duplicate: boolean;
|
|
517
|
+
};
|
|
441
518
|
registerGraphEvidence(value: string | Buffer, access: GraphDerivedAccess | GraphDerivedAccess[]): void;
|
|
442
519
|
getEvidence(digest: string): Buffer | undefined;
|
|
443
520
|
putQaRecoveryHead(input: Omit<QaRecoveryHeadRecord, "updatedAt">, now?: Date): QaRecoveryHeadRecord;
|
|
@@ -504,6 +581,12 @@ export declare class WorkflowDb {
|
|
|
504
581
|
}, expectedRevision: number, now?: Date): QaReducerStateV2;
|
|
505
582
|
recordQaHandoffReceipt(receipt: HandoffAcceptanceReceiptV2): void;
|
|
506
583
|
qaHandoffReceipt(operationId: string): HandoffAcceptanceReceiptV2 | undefined;
|
|
584
|
+
/**
|
|
585
|
+
* Structured authority is admitted only after the one-way v2 cutover has
|
|
586
|
+
* committed. Keeping this at the common admission boundary prevents a
|
|
587
|
+
* caller that opens WorkflowDb directly from bypassing the migration.
|
|
588
|
+
*/
|
|
589
|
+
enableStructuredCommunication(): void;
|
|
507
590
|
beginQaTurn(intent: QaTurnIntentV2): void;
|
|
508
591
|
/** Retire an interrupted, proven read-only review transport, never a QA pass
|
|
509
592
|
* or Builder remediation. A fresh immutable review must still run afterward. */
|
|
@@ -535,8 +618,10 @@ export declare class WorkflowDb {
|
|
|
535
618
|
authorizeContractQaWaiver(runId: string, workId: string, decisionId: string): string;
|
|
536
619
|
commitQaWaiver(runId: string, ticketId: string, expectedRevision: number, reason: string, now?: Date, authorizationRef?: string): QaReducerStateV2;
|
|
537
620
|
builderRemediationReceipt(operationId: string): BuilderRemediationReceiptV2 | BuilderRemediationReceiptV3 | undefined;
|
|
621
|
+
verifiedBuilderRemediationReceipt(operationId: string): BuilderRemediationReceiptV3 | undefined;
|
|
538
622
|
hasConfirmedQaRemediationForRecheck(runId: string, ticketId: string): boolean;
|
|
539
623
|
recordBuilderRemediationReceipt(receipt: BuilderRemediationReceiptV2 | BuilderRemediationReceiptV3): void;
|
|
624
|
+
private assertBuilderRemediationReceipt;
|
|
540
625
|
commitBuilderRemediationSuccess(receipt: BuilderRemediationReceiptV2 | BuilderRemediationReceiptV3, expectedRevision: number, now?: Date): QaReducerStateV2;
|
|
541
626
|
commitQaRemediationOutcome(input: {
|
|
542
627
|
recoveryAttemptId: string;
|
|
@@ -548,6 +633,7 @@ export declare class WorkflowDb {
|
|
|
548
633
|
receipt?: BuilderRemediationReceiptV2 | BuilderRemediationReceiptV3;
|
|
549
634
|
expectedRevision: number;
|
|
550
635
|
}, now?: Date): QaReducerStateV2;
|
|
636
|
+
private assertNativeQaCertificate;
|
|
551
637
|
private assertContractCertificate;
|
|
552
638
|
issueQaPassCertificate(input: Omit<QaPassCertificateV2, "version" | "certificateId" | "unresolvedReportCount" | "issuedAt">, now?: Date): QaPassCertificateV2;
|
|
553
639
|
commitQaPass(input: Omit<QaPassCertificateV2, "version" | "certificateId" | "unresolvedReportCount" | "issuedAt">, expectedRevision: number, now?: Date): QaPassCertificateV2;
|
|
@@ -574,6 +660,7 @@ export declare class WorkflowDb {
|
|
|
574
660
|
expectedRevision: number;
|
|
575
661
|
operationId: string;
|
|
576
662
|
}, now?: Date): QaReducerStateV2;
|
|
663
|
+
assertQaFinalizationAuthority(runId: string, ticketId: string): void;
|
|
577
664
|
planQaFinalizationStep(input: {
|
|
578
665
|
operationId: string;
|
|
579
666
|
runId: string;
|
|
@@ -636,6 +723,9 @@ export declare class WorkflowDb {
|
|
|
636
723
|
compactionAttempt(idempotencyKey: string): CompactionAttemptRecord | undefined;
|
|
637
724
|
unresolvedCompactions(runId: string, role: "builder" | "qa", sessionKey: string): CompactionAttemptRecord[];
|
|
638
725
|
successfulCompactionCount(runId: string, role: "builder" | "qa", providerSession?: string | ProviderSessionRefV1): number;
|
|
726
|
+
freshRecoveryValidation(runId: string, role: "builder" | "qa"): FreshRecoveryValidation;
|
|
727
|
+
/** This grants one response-only initialization, never ownership or business work. */
|
|
728
|
+
assertFreshRecoveryValidation(dispatchId: string, session: ProviderSessionRefV1): void;
|
|
639
729
|
recordRecoveryDecision(receipt: BuildRecoveryDecisionReceipt): void;
|
|
640
730
|
recoveryDecisions(runId: string): BuildRecoveryDecisionReceipt[];
|
|
641
731
|
/**
|
|
@@ -663,5 +753,13 @@ export declare class WorkflowDb {
|
|
|
663
753
|
private refreshRunContinuityHead;
|
|
664
754
|
private insertEvent;
|
|
665
755
|
private migrate;
|
|
756
|
+
/**
|
|
757
|
+
* One-way cutover fence. We deliberately do not attempt to convert an old
|
|
758
|
+
* receipt into authority: any pre-existing run with legacy state or a
|
|
759
|
+
* provider dispatch that lacks a sealed tuple is terminally superseded.
|
|
760
|
+
* User/project artifacts remain in their own tables; only workflow authority
|
|
761
|
+
* is fenced. The marker is committed atomically with the classification.
|
|
762
|
+
*/
|
|
763
|
+
private applyStructuredCommunicationV2Cutover;
|
|
666
764
|
private ensureColumn;
|
|
667
765
|
}
|