snipara-companion 3.0.1 → 3.0.2
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/index.d.ts +3 -1
- package/dist/index.js +161 -17
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2161,6 +2161,8 @@ declare const ENGINEERING_LEAD_WORK_PACKAGE_STATUSES: readonly ["contracting", "
|
|
|
2161
2161
|
declare const ENGINEERING_LEAD_SUPERVISION_STATUSES: readonly ["on_track", "needs_review", "needs_replan", "blocked", "cold_start", "unknown"];
|
|
2162
2162
|
declare const ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES: readonly ["pending_handoff", "handoff_ready", "executing", "verification_required", "blocked", "closed", "unknown"];
|
|
2163
2163
|
declare const ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES: readonly ["handoff", "claim", "approval", "proof", "outcome", "brain_update"];
|
|
2164
|
+
declare const ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES: readonly ["declared", "provided", "verified", "rejected", "unknown"];
|
|
2165
|
+
declare const ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES: readonly ["agent_report", "companion_handoff", "local_command", "ci", "htask", "manual", "unknown"];
|
|
2164
2166
|
type EngineeringLeadPlanSummary = ProjectIntelligenceEngineeringLeadPlanSummary;
|
|
2165
2167
|
interface CompanionEngineeringLeadReconciliation {
|
|
2166
2168
|
status: "on_track" | "needs_review" | "needs_replan" | "blocked";
|
|
@@ -3644,4 +3646,4 @@ declare function buildOrchestratorHandoff(options: OrchestratorHandoffOptions):
|
|
|
3644
3646
|
declare function buildAdaptiveWorkRoutingRecommendation(options: AdaptiveWorkRoutingOptions): AdaptiveWorkRoutingRecommendation;
|
|
3645
3647
|
declare function writeOrchestratorHandoff(options: OrchestratorHandoffOptions): WrittenOrchestratorHandoff;
|
|
3646
3648
|
|
|
3647
|
-
export { AUTOMATION_MANIFEST_RELATIVE_PATH, AutomationInstallConflictError, AutomationUnsupportedHookBundleError, COLLABORATION_STATE_RELATIVE_PATH, ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES, ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES, ENGINEERING_LEAD_POSTURES, ENGINEERING_LEAD_ROUTING_MODES, ENGINEERING_LEAD_STATUSES, ENGINEERING_LEAD_SUPERVISION_STATUSES, ENGINEERING_LEAD_WORKER_ROLES, ENGINEERING_LEAD_WORK_PACKAGE_STATUSES, ORCHESTRATOR_HANDOFF_RELATIVE_PATH, TEAM_SYNC_STATE_RELATIVE_PATH, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, agentReadinessAuditCommand, archiveInactiveTeamSyncWork, attachLocalContextPackReceipts, autoArchiveTeamSyncState, buildAdaptiveWorkRoutingRecommendation, buildAgentReadinessAuditReport, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildCollaborationActor, buildCollaborationGuardActionCards, buildCollaborationHooksInstallPlan, buildCompanionEngineeringLeadPlanReport, buildContextPackStats, buildEvalCaseArtifact, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapQuality, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, createClient, createEmptyCollaborationState, createEmptyTeamSyncState, createLocalQueryCache, deriveLocalCollaborationResourcesFromFiles, detectReleaseSurfacesFromFiles, detectRuntimeEnvironment, evalExportCommand, evalRunCommand, evaluateProjectPolicyGates, extractCommandFromToolInput, extractFilesFromToolInput, formatAgentReadinessAuditReport, formatCompanionEngineeringLeadPlanReport, formatOrchestratorRecommendationReason, formatPolicyGateDecision, formatProjectJudgmentCard, formatStuckGuardDecision, getAutomationManifestPath, getAutomationStatus, getCollaborationStatePath, getConfigPath, getContextPackStoragePaths, getLocalCodeOverlayCachePath, getLocalCodePromotionStatePath, getLocalSourceSnapshotPath, getOrchestratorRecommendation, getPlanStepDisplayTitle, getStagedFiles, getStuckGuardInjection, getTeamSyncStatePath, ingestReferences, installAutomationBundle, leadPlanCommand, listProjectsForApiKey, loadAutomationManifest, loadCollaborationState, loadConfig, loadTeamSyncState, memoryAuditCommand, memoryCleanCandidatesCommand, memoryCompactCommand, memoryHealthCommand, memoryLocalCommand, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readLocalCodeOverlayCache, readLocalCodePromotionState, readLocalSourceSnapshot, referencesIngestCommand, referencesScanCommand, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff };
|
|
3649
|
+
export { AUTOMATION_MANIFEST_RELATIVE_PATH, AutomationInstallConflictError, AutomationUnsupportedHookBundleError, COLLABORATION_STATE_RELATIVE_PATH, ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES, ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES, ENGINEERING_LEAD_POSTURES, ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES, ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES, ENGINEERING_LEAD_ROUTING_MODES, ENGINEERING_LEAD_STATUSES, ENGINEERING_LEAD_SUPERVISION_STATUSES, ENGINEERING_LEAD_WORKER_ROLES, ENGINEERING_LEAD_WORK_PACKAGE_STATUSES, ORCHESTRATOR_HANDOFF_RELATIVE_PATH, TEAM_SYNC_STATE_RELATIVE_PATH, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, agentReadinessAuditCommand, archiveInactiveTeamSyncWork, attachLocalContextPackReceipts, autoArchiveTeamSyncState, buildAdaptiveWorkRoutingRecommendation, buildAgentReadinessAuditReport, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildCollaborationActor, buildCollaborationGuardActionCards, buildCollaborationHooksInstallPlan, buildCompanionEngineeringLeadPlanReport, buildContextPackStats, buildEvalCaseArtifact, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapQuality, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, createClient, createEmptyCollaborationState, createEmptyTeamSyncState, createLocalQueryCache, deriveLocalCollaborationResourcesFromFiles, detectReleaseSurfacesFromFiles, detectRuntimeEnvironment, evalExportCommand, evalRunCommand, evaluateProjectPolicyGates, extractCommandFromToolInput, extractFilesFromToolInput, formatAgentReadinessAuditReport, formatCompanionEngineeringLeadPlanReport, formatOrchestratorRecommendationReason, formatPolicyGateDecision, formatProjectJudgmentCard, formatStuckGuardDecision, getAutomationManifestPath, getAutomationStatus, getCollaborationStatePath, getConfigPath, getContextPackStoragePaths, getLocalCodeOverlayCachePath, getLocalCodePromotionStatePath, getLocalSourceSnapshotPath, getOrchestratorRecommendation, getPlanStepDisplayTitle, getStagedFiles, getStuckGuardInjection, getTeamSyncStatePath, ingestReferences, installAutomationBundle, leadPlanCommand, listProjectsForApiKey, loadAutomationManifest, loadCollaborationState, loadConfig, loadTeamSyncState, memoryAuditCommand, memoryCleanCandidatesCommand, memoryCompactCommand, memoryHealthCommand, memoryLocalCommand, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readLocalCodeOverlayCache, readLocalCodePromotionState, readLocalSourceSnapshot, referencesIngestCommand, referencesScanCommand, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff };
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,8 @@ __export(index_exports, {
|
|
|
38
38
|
ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES: () => ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES,
|
|
39
39
|
ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES: () => ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES,
|
|
40
40
|
ENGINEERING_LEAD_POSTURES: () => ENGINEERING_LEAD_POSTURES,
|
|
41
|
+
ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES: () => ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES,
|
|
42
|
+
ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES: () => ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES,
|
|
41
43
|
ENGINEERING_LEAD_ROUTING_MODES: () => ENGINEERING_LEAD_ROUTING_MODES,
|
|
42
44
|
ENGINEERING_LEAD_STATUSES: () => ENGINEERING_LEAD_STATUSES,
|
|
43
45
|
ENGINEERING_LEAD_SUPERVISION_STATUSES: () => ENGINEERING_LEAD_SUPERVISION_STATUSES,
|
|
@@ -10985,11 +10987,11 @@ function hostedHandoffTests(hosted) {
|
|
|
10985
10987
|
var ADAPTER_TARGETS = {
|
|
10986
10988
|
codex: {
|
|
10987
10989
|
label: "Codex",
|
|
10988
|
-
instruction: "Use Hosted MCP and AGENTS.md first; keep companion phase state visible."
|
|
10990
|
+
instruction: "Use Hosted MCP and AGENTS.md first; keep companion phase state visible and return the canonical proof receipt."
|
|
10989
10991
|
},
|
|
10990
10992
|
"claude-code": {
|
|
10991
10993
|
label: "Claude Code",
|
|
10992
|
-
instruction: "Use generated/local instructions and return proof through companion handoff."
|
|
10994
|
+
instruction: "Use generated/local instructions and return proof through companion handoff using the canonical receipt fields."
|
|
10993
10995
|
},
|
|
10994
10996
|
cursor: {
|
|
10995
10997
|
label: "Cursor",
|
|
@@ -11008,6 +11010,7 @@ var ADAPTER_TARGETS = {
|
|
|
11008
11010
|
instruction: "Require the receiving worker to echo the receipt fields before closure."
|
|
11009
11011
|
}
|
|
11010
11012
|
};
|
|
11013
|
+
var FIRST_PARTY_ADAPTER_TARGETS = ["codex", "claude-code"];
|
|
11011
11014
|
function normalizeAdapterTarget(value) {
|
|
11012
11015
|
const normalized = (value ?? "codex").trim().toLowerCase();
|
|
11013
11016
|
if (normalized === "claude" || normalized === "claude_code") {
|
|
@@ -11018,6 +11021,14 @@ function normalizeAdapterTarget(value) {
|
|
|
11018
11021
|
}
|
|
11019
11022
|
return "custom";
|
|
11020
11023
|
}
|
|
11024
|
+
function assertSupportedAdapterTarget(targetId) {
|
|
11025
|
+
if (FIRST_PARTY_ADAPTER_TARGETS.includes(targetId)) {
|
|
11026
|
+
return;
|
|
11027
|
+
}
|
|
11028
|
+
throw new Error(
|
|
11029
|
+
`ADE Adapter Pack V1 currently supports codex and claude-code only; ${targetId} is planned but not enabled.`
|
|
11030
|
+
);
|
|
11031
|
+
}
|
|
11021
11032
|
function normalizeAdapterValues(values) {
|
|
11022
11033
|
return [
|
|
11023
11034
|
...new Set(
|
|
@@ -11058,7 +11069,8 @@ function buildAdapterPrompt(input) {
|
|
|
11058
11069
|
input.record.files.length > 0 ? `File scope: ${input.record.files.join(", ")}` : "File scope: not declared",
|
|
11059
11070
|
input.proofGates.length > 0 ? `Proof gates: ${input.proofGates.join("; ")}` : "Proof gates: provide explicit evidence before closure.",
|
|
11060
11071
|
input.acceptanceCriteria.length > 0 ? `Acceptance criteria: ${input.acceptanceCriteria.join("; ")}` : "Acceptance criteria: use the next step and handoff summary as the minimum contract.",
|
|
11061
|
-
"Return a companion handoff receipt with files changed, commands run, proof evidence, blockers, and
|
|
11072
|
+
"Return a companion handoff receipt with files changed, commands run, proof evidence, blockers, next action, and proofVerification status.",
|
|
11073
|
+
"Treat proof evidence as provided until Snipara validates the source and records proofVerification.status=verified."
|
|
11062
11074
|
].join("\n");
|
|
11063
11075
|
}
|
|
11064
11076
|
function buildAgenticHandoffAdapterPack(input) {
|
|
@@ -11066,6 +11078,7 @@ function buildAgenticHandoffAdapterPack(input) {
|
|
|
11066
11078
|
return void 0;
|
|
11067
11079
|
}
|
|
11068
11080
|
const targetId = normalizeAdapterTarget(input.options.adapterTarget);
|
|
11081
|
+
assertSupportedAdapterTarget(targetId);
|
|
11069
11082
|
const target = ADAPTER_TARGETS[targetId];
|
|
11070
11083
|
const contextRefs = normalizeAdapterValues(input.options.context);
|
|
11071
11084
|
const explicitProof = normalizeAdapterValues(input.options.proof);
|
|
@@ -11090,7 +11103,7 @@ function buildAgenticHandoffAdapterPack(input) {
|
|
|
11090
11103
|
constraints: [
|
|
11091
11104
|
"Use this artifact as a work contract, not as approval to expand scope silently.",
|
|
11092
11105
|
"Keep secrets out of handoff receipts and proof notes.",
|
|
11093
|
-
"Do not close the task until proof gates are addressed or an explicit waiver is recorded.",
|
|
11106
|
+
"Do not close the task until proof gates are addressed and proofVerification.status is verified or an explicit waiver is recorded.",
|
|
11094
11107
|
input.gitStatus.length > 0 ? `${input.gitStatus.length} dirty git file(s) existed when this pack was generated.` : "No dirty git file count was added to the adapter constraints."
|
|
11095
11108
|
]
|
|
11096
11109
|
},
|
|
@@ -11105,6 +11118,8 @@ function buildAgenticHandoffAdapterPack(input) {
|
|
|
11105
11118
|
"filesChanged",
|
|
11106
11119
|
"commandsRun",
|
|
11107
11120
|
"proofEvidence",
|
|
11121
|
+
"proofVerificationStatus",
|
|
11122
|
+
"proofSource",
|
|
11108
11123
|
"blockers",
|
|
11109
11124
|
"nextAction"
|
|
11110
11125
|
]
|
|
@@ -11118,8 +11133,9 @@ function buildAgenticHandoffAdapterPack(input) {
|
|
|
11118
11133
|
}),
|
|
11119
11134
|
caveats: [
|
|
11120
11135
|
"ADE Adapter Pack V1 is a portable contract; it does not control the target client runtime.",
|
|
11136
|
+
"First-party adapter packs are currently limited to Codex and Claude Code.",
|
|
11121
11137
|
"Native hooks or IDE-specific automation must be installed separately when they exist.",
|
|
11122
|
-
"The receiving agent
|
|
11138
|
+
"The receiving agent can provide proof evidence, but Snipara must validate the source before treating proof as verified."
|
|
11123
11139
|
]
|
|
11124
11140
|
};
|
|
11125
11141
|
}
|
|
@@ -19083,6 +19099,22 @@ var PROJECT_INTELLIGENCE_ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES = [
|
|
|
19083
19099
|
"outcome",
|
|
19084
19100
|
"brain_update"
|
|
19085
19101
|
];
|
|
19102
|
+
var PROJECT_INTELLIGENCE_ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES = [
|
|
19103
|
+
"declared",
|
|
19104
|
+
"provided",
|
|
19105
|
+
"verified",
|
|
19106
|
+
"rejected",
|
|
19107
|
+
"unknown"
|
|
19108
|
+
];
|
|
19109
|
+
var PROJECT_INTELLIGENCE_ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES = [
|
|
19110
|
+
"agent_report",
|
|
19111
|
+
"companion_handoff",
|
|
19112
|
+
"local_command",
|
|
19113
|
+
"ci",
|
|
19114
|
+
"htask",
|
|
19115
|
+
"manual",
|
|
19116
|
+
"unknown"
|
|
19117
|
+
];
|
|
19086
19118
|
|
|
19087
19119
|
// src/commands/lead-plan.ts
|
|
19088
19120
|
var ENGINEERING_LEAD_STATUSES = PROJECT_HEALTH_COCKPIT_STATUSES;
|
|
@@ -19093,6 +19125,8 @@ var ENGINEERING_LEAD_WORK_PACKAGE_STATUSES = PROJECT_INTELLIGENCE_ENGINEERING_LE
|
|
|
19093
19125
|
var ENGINEERING_LEAD_SUPERVISION_STATUSES = PROJECT_INTELLIGENCE_ENGINEERING_LEAD_SUPERVISION_STATUSES;
|
|
19094
19126
|
var ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES = PROJECT_INTELLIGENCE_ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES;
|
|
19095
19127
|
var ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES = PROJECT_INTELLIGENCE_ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES;
|
|
19128
|
+
var ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES = PROJECT_INTELLIGENCE_ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES;
|
|
19129
|
+
var ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES = PROJECT_INTELLIGENCE_ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES;
|
|
19096
19130
|
var TARGET_LABELS = {
|
|
19097
19131
|
codex: "Codex",
|
|
19098
19132
|
"claude-code": "Claude Code",
|
|
@@ -19158,6 +19192,61 @@ function cockpitEnumValue(field, values, value, fallback) {
|
|
|
19158
19192
|
function compactReasonCodes(values) {
|
|
19159
19193
|
return values.filter((value) => Boolean(value));
|
|
19160
19194
|
}
|
|
19195
|
+
function defaultProofVerificationStatus(input) {
|
|
19196
|
+
if (input.proofEvidenceProvided) {
|
|
19197
|
+
return "provided";
|
|
19198
|
+
}
|
|
19199
|
+
return input.proofRequired.length > 0 ? "declared" : "unknown";
|
|
19200
|
+
}
|
|
19201
|
+
function buildProofVerification(input) {
|
|
19202
|
+
return {
|
|
19203
|
+
status: input.status,
|
|
19204
|
+
source: input.source ?? "unknown",
|
|
19205
|
+
sourceRef: input.sourceRef ?? null,
|
|
19206
|
+
adapterTarget: input.adapterTarget ?? null,
|
|
19207
|
+
verifiedBy: input.verifiedBy ?? null,
|
|
19208
|
+
verifiedAt: input.verifiedAt ?? null,
|
|
19209
|
+
evidenceHash: input.evidenceHash ?? null,
|
|
19210
|
+
reasonCodes: [
|
|
19211
|
+
.../* @__PURE__ */ new Set([
|
|
19212
|
+
...input.reasonCodes ?? [],
|
|
19213
|
+
`proof_verification_${input.status}`,
|
|
19214
|
+
...input.status === "verified" ? [] : ["proof_verification_pending_validation"]
|
|
19215
|
+
])
|
|
19216
|
+
]
|
|
19217
|
+
};
|
|
19218
|
+
}
|
|
19219
|
+
function normalizeProofVerification(input) {
|
|
19220
|
+
const fallbackStatus = defaultProofVerificationStatus(input);
|
|
19221
|
+
if (!isRecord8(input.value)) {
|
|
19222
|
+
return buildProofVerification({ status: fallbackStatus });
|
|
19223
|
+
}
|
|
19224
|
+
const status = cockpitEnumValue(
|
|
19225
|
+
"proof_verification_status",
|
|
19226
|
+
ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES,
|
|
19227
|
+
input.value.status,
|
|
19228
|
+
fallbackStatus
|
|
19229
|
+
);
|
|
19230
|
+
const source2 = cockpitEnumValue(
|
|
19231
|
+
"proof_verification_source",
|
|
19232
|
+
ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES,
|
|
19233
|
+
input.value.source,
|
|
19234
|
+
"unknown"
|
|
19235
|
+
);
|
|
19236
|
+
return buildProofVerification({
|
|
19237
|
+
status: status.value,
|
|
19238
|
+
source: source2.value,
|
|
19239
|
+
sourceRef: stringValue5(input.value.sourceRef) ?? null,
|
|
19240
|
+
adapterTarget: stringValue5(input.value.adapterTarget) ?? null,
|
|
19241
|
+
verifiedBy: stringValue5(input.value.verifiedBy) ?? null,
|
|
19242
|
+
verifiedAt: stringValue5(input.value.verifiedAt) ?? null,
|
|
19243
|
+
evidenceHash: stringValue5(input.value.evidenceHash) ?? null,
|
|
19244
|
+
reasonCodes: [
|
|
19245
|
+
...stringList(input.value.reasonCodes),
|
|
19246
|
+
...compactReasonCodes([status.droppedReasonCode, source2.droppedReasonCode])
|
|
19247
|
+
]
|
|
19248
|
+
});
|
|
19249
|
+
}
|
|
19161
19250
|
function slug(value, fallback) {
|
|
19162
19251
|
const normalized = value.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 48);
|
|
19163
19252
|
return normalized || fallback;
|
|
@@ -19466,9 +19555,13 @@ function missingRequirementsForExecutionReceipt(input) {
|
|
|
19466
19555
|
if (input.requiredStages.includes("approval") && !completed.has("approval")) {
|
|
19467
19556
|
missing.add("approval_receipt");
|
|
19468
19557
|
}
|
|
19469
|
-
|
|
19558
|
+
const proofEvidenceProvided = input.proofEvidenceProvided ?? completed.has("proof");
|
|
19559
|
+
if (input.requiredStages.includes("proof") && !proofEvidenceProvided) {
|
|
19470
19560
|
missing.add("proof_receipt");
|
|
19471
19561
|
}
|
|
19562
|
+
if (input.requiredStages.includes("proof") && proofEvidenceProvided && input.workPackage.proofRequired.length > 0 && input.proofVerificationStatus !== "verified") {
|
|
19563
|
+
missing.add("verified_proof");
|
|
19564
|
+
}
|
|
19472
19565
|
if (input.requiredStages.includes("outcome") && !completed.has("outcome")) {
|
|
19473
19566
|
missing.add("outcome_receipt");
|
|
19474
19567
|
}
|
|
@@ -19479,7 +19572,7 @@ function missingRequirementsForExecutionReceipt(input) {
|
|
|
19479
19572
|
}
|
|
19480
19573
|
function executionReceiptStatusFromWorkPackage(input) {
|
|
19481
19574
|
if (input.workPackage.status === "blocked") return "blocked";
|
|
19482
|
-
if (input.workPackage.status === "closed" && input.requiredStages.every((stage) => input.completedStages.includes(stage))) {
|
|
19575
|
+
if (input.workPackage.status === "closed" && input.requiredStages.every((stage) => input.completedStages.includes(stage)) && input.missingRequirements.length === 0) {
|
|
19483
19576
|
return "closed";
|
|
19484
19577
|
}
|
|
19485
19578
|
if (input.workPackage.status === "executing") return "executing";
|
|
@@ -19501,6 +19594,9 @@ function executionReceiptNextAction(input) {
|
|
|
19501
19594
|
if (input.missingRequirements.includes("proof_receipt")) {
|
|
19502
19595
|
return "Attach proof receipts before closure.";
|
|
19503
19596
|
}
|
|
19597
|
+
if (input.missingRequirements.includes("verified_proof")) {
|
|
19598
|
+
return "Validate the proof source before treating this package as complete.";
|
|
19599
|
+
}
|
|
19504
19600
|
if (input.missingRequirements.includes("outcome_receipt")) {
|
|
19505
19601
|
return "Attach an outcome or closure receipt before Brain promotion.";
|
|
19506
19602
|
}
|
|
@@ -19555,6 +19651,9 @@ function buildExpectedExecutionReceipts(input) {
|
|
|
19555
19651
|
brainUpdateReceiptId: null,
|
|
19556
19652
|
proofRequired: workPackage.proofRequired,
|
|
19557
19653
|
proofExecuted: [],
|
|
19654
|
+
proofVerification: buildProofVerification({
|
|
19655
|
+
status: workPackage.proofRequired.length > 0 ? "declared" : "unknown"
|
|
19656
|
+
}),
|
|
19558
19657
|
missingRequirements,
|
|
19559
19658
|
nextAction: executionReceiptNextAction({ status, missingRequirements }),
|
|
19560
19659
|
replanTriggers: workPackage.replanTriggers,
|
|
@@ -19803,13 +19902,30 @@ function normalizeExecutionReceipt(value, index, workPackages, workerRecommendat
|
|
|
19803
19902
|
(stage) => normalizedRequiredStages.includes(stage)
|
|
19804
19903
|
);
|
|
19805
19904
|
const brainUpdateCandidates2 = stringList(value.brainUpdateCandidates).length > 0 ? stringList(value.brainUpdateCandidates) : recommendation?.brainUpdateCandidates ?? [];
|
|
19905
|
+
const proofReceiptIds = stringList(value.proofReceiptIds);
|
|
19906
|
+
const proofRequired = stringList(value.proofRequired).length > 0 ? stringList(value.proofRequired) : workPackage?.proofRequired ?? [];
|
|
19907
|
+
const proofExecuted = stringList(value.proofExecuted);
|
|
19908
|
+
const proofEvidenceProvided = proofReceiptIds.length > 0 || proofExecuted.length > 0 || normalizedCompletedStages.includes("proof");
|
|
19909
|
+
const proofVerification = normalizeProofVerification({
|
|
19910
|
+
value: value.proofVerification,
|
|
19911
|
+
proofRequired,
|
|
19912
|
+
proofEvidenceProvided
|
|
19913
|
+
});
|
|
19806
19914
|
const derivedMissing = workPackage && missingRequirementsForExecutionReceipt({
|
|
19807
19915
|
workPackage,
|
|
19808
19916
|
requiredStages: normalizedRequiredStages,
|
|
19809
19917
|
completedStages: normalizedCompletedStages,
|
|
19810
|
-
brainUpdateCandidates: brainUpdateCandidates2
|
|
19918
|
+
brainUpdateCandidates: brainUpdateCandidates2,
|
|
19919
|
+
proofVerificationStatus: proofVerification.status,
|
|
19920
|
+
proofEvidenceProvided
|
|
19811
19921
|
});
|
|
19812
|
-
const
|
|
19922
|
+
const missingRequirementsSet = new Set(
|
|
19923
|
+
stringList(value.missingRequirements).length > 0 ? stringList(value.missingRequirements) : derivedMissing ?? []
|
|
19924
|
+
);
|
|
19925
|
+
if (normalizedRequiredStages.includes("proof") && proofRequired.length > 0 && proofEvidenceProvided && proofVerification.status !== "verified") {
|
|
19926
|
+
missingRequirementsSet.add("verified_proof");
|
|
19927
|
+
}
|
|
19928
|
+
const missingRequirements = Array.from(missingRequirementsSet).sort();
|
|
19813
19929
|
const fallbackStatus = workPackage ? executionReceiptStatusFromWorkPackage({
|
|
19814
19930
|
workPackage,
|
|
19815
19931
|
requiredStages: normalizedRequiredStages,
|
|
@@ -19822,33 +19938,42 @@ function normalizeExecutionReceipt(value, index, workPackages, workerRecommendat
|
|
|
19822
19938
|
value.status,
|
|
19823
19939
|
fallbackStatus
|
|
19824
19940
|
);
|
|
19941
|
+
const effectiveStatus = status.value === "closed" && missingRequirements.length > 0 ? "verification_required" : status.value;
|
|
19942
|
+
const statusReasonCodes = compactReasonCodes([
|
|
19943
|
+
status.droppedReasonCode,
|
|
19944
|
+
status.value === "closed" && effectiveStatus === "verification_required" ? "companion_downgraded_closed_execution_receipt_pending_verification" : null
|
|
19945
|
+
]);
|
|
19825
19946
|
return {
|
|
19826
19947
|
id: stringValue5(value.id) ?? `engineering-lead-receipt:${workPackageId}`,
|
|
19827
19948
|
workPackageId,
|
|
19828
19949
|
workPackageTitle: stringValue5(value.workPackageTitle) ?? workPackage?.title ?? `Imported work package ${index + 1}`,
|
|
19829
|
-
status:
|
|
19950
|
+
status: effectiveStatus,
|
|
19830
19951
|
requiredStages: normalizedRequiredStages,
|
|
19831
19952
|
completedStages: normalizedCompletedStages,
|
|
19832
19953
|
handoffReceiptId: stringValue5(value.handoffReceiptId) ?? null,
|
|
19833
19954
|
claimId: stringValue5(value.claimId) ?? null,
|
|
19834
19955
|
htaskId: stringValue5(value.htaskId) ?? null,
|
|
19835
19956
|
approvalReceiptId: stringValue5(value.approvalReceiptId) ?? null,
|
|
19836
|
-
proofReceiptIds
|
|
19957
|
+
proofReceiptIds,
|
|
19837
19958
|
outcomeReceiptId: stringValue5(value.outcomeReceiptId) ?? null,
|
|
19838
19959
|
brainUpdateReceiptId: stringValue5(value.brainUpdateReceiptId) ?? null,
|
|
19839
|
-
proofRequired
|
|
19840
|
-
proofExecuted
|
|
19960
|
+
proofRequired,
|
|
19961
|
+
proofExecuted,
|
|
19962
|
+
proofVerification,
|
|
19841
19963
|
missingRequirements,
|
|
19842
|
-
nextAction: stringValue5(value.nextAction) ?? executionReceiptNextAction({ status:
|
|
19964
|
+
nextAction: stringValue5(value.nextAction) ?? executionReceiptNextAction({ status: effectiveStatus, missingRequirements }),
|
|
19843
19965
|
replanTriggers: stringList(value.replanTriggers).length > 0 ? stringList(value.replanTriggers) : workPackage?.replanTriggers ?? [],
|
|
19844
19966
|
brainUpdateCandidates: brainUpdateCandidates2,
|
|
19845
19967
|
evidence: normalizeEvidence(value.evidence).length > 0 ? normalizeEvidence(value.evidence) : workPackage?.evidence ?? [],
|
|
19846
19968
|
reasonCodes: [
|
|
19847
19969
|
.../* @__PURE__ */ new Set([
|
|
19848
19970
|
...stringList(value.reasonCodes),
|
|
19849
|
-
...
|
|
19971
|
+
...statusReasonCodes,
|
|
19850
19972
|
...requiredStages.reasonCodes,
|
|
19851
|
-
...completedStages.reasonCodes
|
|
19973
|
+
...completedStages.reasonCodes,
|
|
19974
|
+
...proofVerification.reasonCodes.filter(
|
|
19975
|
+
(code2) => code2.startsWith("companion_dropped_unknown_")
|
|
19976
|
+
)
|
|
19852
19977
|
])
|
|
19853
19978
|
]
|
|
19854
19979
|
};
|
|
@@ -20086,11 +20211,19 @@ function reconcileEngineeringLeadPlan(input) {
|
|
|
20086
20211
|
recommendedActions.add(trigger);
|
|
20087
20212
|
}
|
|
20088
20213
|
for (const receipt of executionReceipts) {
|
|
20214
|
+
const proofEvidenceProvided = receipt.proofReceiptIds.length > 0 || receipt.proofExecuted.length > 0 || receipt.completedStages.includes("proof");
|
|
20089
20215
|
if (receipt.status === "blocked") {
|
|
20090
20216
|
changedSignals.add(`blocked_execution_receipt:${receipt.workPackageId}`);
|
|
20091
20217
|
recommendedActions.add(receipt.nextAction);
|
|
20092
20218
|
reasonCodes.add("companion_reconcile_execution_receipt_blocked");
|
|
20093
20219
|
}
|
|
20220
|
+
if (receipt.requiredStages.includes("proof") && proofEvidenceProvided && receipt.proofVerification?.status !== "verified") {
|
|
20221
|
+
changedSignals.add(`execution_receipt_unverified_proof:${receipt.workPackageId}`);
|
|
20222
|
+
recommendedActions.add(
|
|
20223
|
+
`Validate proof source for ${receipt.workPackageTitle} before closure.`
|
|
20224
|
+
);
|
|
20225
|
+
reasonCodes.add("companion_reconcile_execution_receipt_unverified_proof");
|
|
20226
|
+
}
|
|
20094
20227
|
if (receipt.missingRequirements.length > 0) {
|
|
20095
20228
|
changedSignals.add(
|
|
20096
20229
|
`execution_receipt_missing:${receipt.workPackageId}:${receipt.missingRequirements.join(",")}`
|
|
@@ -20281,6 +20414,15 @@ function formatCompanionEngineeringLeadPlanReport(report) {
|
|
|
20281
20414
|
lines.push(` handoff receipt: ${receipt.handoffReceiptId ?? "missing"}`);
|
|
20282
20415
|
lines.push(` claim: ${receipt.claimId ?? "missing"}`);
|
|
20283
20416
|
lines.push(` approval receipt: ${receipt.approvalReceiptId ?? "missing"}`);
|
|
20417
|
+
lines.push(` proof receipts: ${formatList3(receipt.proofReceiptIds)}`);
|
|
20418
|
+
if (receipt.proofVerification) {
|
|
20419
|
+
lines.push(
|
|
20420
|
+
` proof verification: ${receipt.proofVerification.status} (${receipt.proofVerification.source})`
|
|
20421
|
+
);
|
|
20422
|
+
if (receipt.proofVerification.adapterTarget) {
|
|
20423
|
+
lines.push(` proof adapter target: ${receipt.proofVerification.adapterTarget}`);
|
|
20424
|
+
}
|
|
20425
|
+
}
|
|
20284
20426
|
lines.push(` outcome receipt: ${receipt.outcomeReceiptId ?? "missing"}`);
|
|
20285
20427
|
lines.push(` brain update receipt: ${receipt.brainUpdateReceiptId ?? "missing"}`);
|
|
20286
20428
|
lines.push(` missing: ${formatList3(receipt.missingRequirements)}`);
|
|
@@ -25047,7 +25189,7 @@ program.command("timeline").description("Show recent workflow phase commits, che
|
|
|
25047
25189
|
json: Boolean(options.json)
|
|
25048
25190
|
});
|
|
25049
25191
|
});
|
|
25050
|
-
program.command("handoff").description("Create an agent-ready handoff artifact and persist Team Sync continuity").option("--summary <summary>", "What changed in this session").option("--next <next>", "Recommended next action").option("--files <files...>", "Relevant files").option("--attention <attention>", "Attention level (note|watch|review|proof)").option("--risk <risk>", "Compatibility alias for --attention").option("--actor <actor>", "Actor or agent name").option("--adapter-pack", "Attach an ADE Adapter Pack V1 to the handoff artifact").option("--target <target>", "ADE target (codex|claude-code
|
|
25192
|
+
program.command("handoff").description("Create an agent-ready handoff artifact and persist Team Sync continuity").option("--summary <summary>", "What changed in this session").option("--next <next>", "Recommended next action").option("--files <files...>", "Relevant files").option("--attention <attention>", "Attention level (note|watch|review|proof)").option("--risk <risk>", "Compatibility alias for --attention").option("--actor <actor>", "Actor or agent name").option("--adapter-pack", "Attach an ADE Adapter Pack V1 to the handoff artifact").option("--target <target>", "ADE adapter-pack target (codex|claude-code)").option("--context <refs...>", "Context references for the adapter pack").option("--proof <proof...>", "Proof gates expected from the receiving agent").option("--acceptance <criteria...>", "Acceptance criteria for the receiving agent").option(
|
|
25051
25193
|
"--conflict-posture <posture>",
|
|
25052
25194
|
"Conflict posture (continue|wait|split_work|review_only|handoff)"
|
|
25053
25195
|
).option("-d, --dir <directory>", "Project directory (default: current)").option("-o, --output <file>", "Write the handoff artifact to Markdown or JSON").option("--json", "Print raw JSON").action(async (options) => {
|
|
@@ -26710,6 +26852,8 @@ if (require.main === module) {
|
|
|
26710
26852
|
ENGINEERING_LEAD_EXECUTION_RECEIPT_STAGES,
|
|
26711
26853
|
ENGINEERING_LEAD_EXECUTION_RECEIPT_STATUSES,
|
|
26712
26854
|
ENGINEERING_LEAD_POSTURES,
|
|
26855
|
+
ENGINEERING_LEAD_PROOF_VERIFICATION_SOURCES,
|
|
26856
|
+
ENGINEERING_LEAD_PROOF_VERIFICATION_STATUSES,
|
|
26713
26857
|
ENGINEERING_LEAD_ROUTING_MODES,
|
|
26714
26858
|
ENGINEERING_LEAD_STATUSES,
|
|
26715
26859
|
ENGINEERING_LEAD_SUPERVISION_STATUSES,
|