snipara-companion 3.0.5 → 3.0.7

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 CHANGED
@@ -43,10 +43,12 @@ These commands are useful without hosted Snipara:
43
43
  | ------------------------------------------------------------ | ------------------------------------------------------------ |
44
44
  | `source init` / `source sync` / `source status` | Local source snapshot, document preview, and code overlay |
45
45
  | `impact` / `code impact` | File-level blast-radius from the local code overlay |
46
+ | `reality-check` | Intent/verification checks for local or supplied changes |
46
47
  | `code callers` / `imports` / `neighbors` / `shortest-path` | Structural repo questions from local files |
47
48
  | `workflow start` / `phase-start` / `phase-commit` / `resume` | Agent continuity that survives compaction |
48
49
  | `context-pack` | Reversible local packs for long logs, diffs, and tool output |
49
50
  | `judgment-card`, `verify`, `lead-plan`, `agent-readiness` | Local review artifacts and delegation contracts |
51
+ | `intelligence ledger-export` | Structured redacted ledger JSON for replay and review |
50
52
  | `stuck-guard`, `memory-guard`, `pre-tool`, `post-tool` | Fail-soft local guards and hook helpers |
51
53
 
52
54
  ## Agent Continuity
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { ProjectIntelligenceEngineeringLeadPlanSummary } from '@snipara/project-intelligence-contracts';
2
+ import { ProjectRealityCheckResult, ProjectIntelligenceEngineeringLeadPlanSummary } from '@snipara/project-intelligence-contracts';
3
3
 
4
4
  declare function resolveQueryFromToolInput(toolInput?: string, tool?: string): string | null;
5
5
 
@@ -1946,6 +1946,23 @@ interface ProjectIntelligenceBrief {
1946
1946
  declare function buildProjectIntelligenceBrief(options: ProjectIntelligenceBriefOptions): Promise<ProjectIntelligenceBrief>;
1947
1947
  declare function projectIntelligenceBriefCommand(options: ProjectIntelligenceBriefOptions): Promise<void>;
1948
1948
 
1949
+ interface RealityCheckCommandOptions {
1950
+ task?: string;
1951
+ branch?: string;
1952
+ base?: string;
1953
+ changedFiles?: string[];
1954
+ diffSummary?: string;
1955
+ decision?: string[];
1956
+ document?: string[];
1957
+ verification?: string[];
1958
+ includeDirty?: boolean;
1959
+ enforce?: boolean;
1960
+ dir?: string;
1961
+ json?: boolean;
1962
+ }
1963
+ declare function buildLocalProjectRealityCheck(options: RealityCheckCommandOptions): ProjectRealityCheckResult;
1964
+ declare function realityCheckCommand(options: RealityCheckCommandOptions): Promise<void>;
1965
+
1949
1966
  interface MemoryHealthCommandOptions {
1950
1967
  scope?: MemoryScope;
1951
1968
  includeInactive?: boolean;
@@ -2366,6 +2383,195 @@ interface ProjectIntelligenceRunResult {
2366
2383
  declare function buildProjectIntelligenceRun(options: ProjectRunCommandOptions): Promise<ProjectIntelligenceRunResult>;
2367
2384
  declare function projectIntelligenceRunCommand(options: ProjectRunCommandOptions): Promise<void>;
2368
2385
 
2386
+ declare const WHY_OUTCOME_CAPTURE_VERSION: "snipara.why_outcome_capture.v1";
2387
+ type WhyOutcomeCaptureEventKind = "commit" | "pull_request" | "phase_commit" | "handoff" | "final_commit" | "guard_decision" | "test_result" | "deploy_health" | "review_result" | "feedback";
2388
+ type WhyOutcomeCandidateKind = "decision" | "outcome";
2389
+ type WhyOutcomeCandidateOutcomeStatus = "positive" | "negative" | "blocked" | "neutral" | "unknown";
2390
+ interface WhyOutcomeCaptureEvent {
2391
+ kind?: WhyOutcomeCaptureEventKind | string;
2392
+ event?: WhyOutcomeCaptureEventKind | string;
2393
+ summary?: string;
2394
+ reason?: string | string[];
2395
+ outcome?: string;
2396
+ status?: string;
2397
+ feedback?: string;
2398
+ sourceRef?: string;
2399
+ actor?: string;
2400
+ files?: string[];
2401
+ evidence?: string[];
2402
+ commands?: string[];
2403
+ reviewResult?: string;
2404
+ observedAt?: string;
2405
+ metadata?: Record<string, unknown>;
2406
+ }
2407
+ interface WhyOutcomeCaptureCandidate {
2408
+ id: string;
2409
+ kind: WhyOutcomeCandidateKind;
2410
+ reviewStatus: "review_pending";
2411
+ authorityStatus: "candidate";
2412
+ content: string;
2413
+ confidence: number;
2414
+ source: {
2415
+ kind: WhyOutcomeCaptureEventKind;
2416
+ ref: string | null;
2417
+ actor: string | null;
2418
+ observedAt: string;
2419
+ };
2420
+ outcome?: {
2421
+ status: WhyOutcomeCandidateOutcomeStatus;
2422
+ label: string;
2423
+ };
2424
+ provenance: {
2425
+ files: string[];
2426
+ evidence: string[];
2427
+ commands: string[];
2428
+ reasonCodes: string[];
2429
+ dedupeKey: string;
2430
+ };
2431
+ redaction: {
2432
+ redacted: boolean;
2433
+ patterns: string[];
2434
+ };
2435
+ }
2436
+ interface WhyOutcomeCaptureReport {
2437
+ version: typeof WHY_OUTCOME_CAPTURE_VERSION;
2438
+ generatedAt: string;
2439
+ reviewStatus: "review_pending";
2440
+ eventCount: number;
2441
+ candidateCount: number;
2442
+ skippedDuplicateCount: number;
2443
+ candidates: WhyOutcomeCaptureCandidate[];
2444
+ caveats: string[];
2445
+ }
2446
+ interface WhyOutcomeCaptureOptions {
2447
+ events: WhyOutcomeCaptureEvent[];
2448
+ now?: Date;
2449
+ maxCandidates?: number;
2450
+ }
2451
+ interface OutcomeCapturePreviewCommandOptions {
2452
+ fromFile?: string;
2453
+ event?: string;
2454
+ summary?: string;
2455
+ outcome?: string;
2456
+ status?: string;
2457
+ sourceRef?: string;
2458
+ actor?: string;
2459
+ files?: string[];
2460
+ evidence?: string[];
2461
+ command?: string[];
2462
+ reason?: string[];
2463
+ feedback?: string;
2464
+ maxCandidates?: string;
2465
+ json?: boolean;
2466
+ }
2467
+ declare function buildWhyOutcomeCaptureReport(options: WhyOutcomeCaptureOptions): WhyOutcomeCaptureReport;
2468
+ declare function outcomeCapturePreviewCommand(options: OutcomeCapturePreviewCommandOptions): Promise<void>;
2469
+
2470
+ declare const CODING_INTELLIGENCE_LEDGER_VERSION: "snipara.coding_intelligence_ledger.v0";
2471
+ type CodingLedgerSectionName = "served_context" | "plans" | "diffs" | "tests" | "ci" | "reviews" | "outcomes" | "influence_receipts";
2472
+ type CodingLedgerConfidenceBand = "high" | "medium" | "low" | "unknown";
2473
+ interface CodingLedgerEvidenceItem {
2474
+ id: string;
2475
+ kind: CodingLedgerSectionName;
2476
+ title?: string;
2477
+ summary: string;
2478
+ sourceRef?: string;
2479
+ status?: string;
2480
+ confidence?: number;
2481
+ reasonCodes: string[];
2482
+ files: string[];
2483
+ commands: string[];
2484
+ observedAt?: string;
2485
+ }
2486
+ interface CodingLedgerPrompt {
2487
+ task?: string;
2488
+ prompt?: string;
2489
+ sourceRef?: string;
2490
+ }
2491
+ interface CodingLedgerRepoState {
2492
+ branch?: string;
2493
+ commit?: string;
2494
+ dirty?: boolean;
2495
+ stagedFileCount?: number;
2496
+ unstagedFileCount?: number;
2497
+ changedFiles: string[];
2498
+ recentFiles: string[];
2499
+ diffSummary?: string;
2500
+ }
2501
+ interface CodingLedgerConfidence {
2502
+ score?: number;
2503
+ band: CodingLedgerConfidenceBand;
2504
+ rationale?: string;
2505
+ }
2506
+ interface CodingLedgerCalibrationMetadata {
2507
+ sampleSize?: number;
2508
+ reliability?: number;
2509
+ status?: string;
2510
+ notes: string[];
2511
+ caveats: string[];
2512
+ }
2513
+ interface CodingLedgerRedactionSummary {
2514
+ redacted: boolean;
2515
+ redactedValueCount: number;
2516
+ patterns: string[];
2517
+ }
2518
+ interface CodingIntelligenceLedger {
2519
+ version: typeof CODING_INTELLIGENCE_LEDGER_VERSION;
2520
+ generatedAt: string;
2521
+ portability: {
2522
+ format: "json";
2523
+ schema: typeof CODING_INTELLIGENCE_LEDGER_VERSION;
2524
+ generatedBy: "snipara-companion";
2525
+ contentModel: "structured_redacted_ledger";
2526
+ };
2527
+ prompt: CodingLedgerPrompt;
2528
+ repoState: CodingLedgerRepoState;
2529
+ servedContext: CodingLedgerEvidenceItem[];
2530
+ plans: CodingLedgerEvidenceItem[];
2531
+ diffs: CodingLedgerEvidenceItem[];
2532
+ tests: CodingLedgerEvidenceItem[];
2533
+ ci: CodingLedgerEvidenceItem[];
2534
+ reviews: CodingLedgerEvidenceItem[];
2535
+ outcomes: CodingLedgerEvidenceItem[];
2536
+ influenceReceipts: CodingLedgerEvidenceItem[];
2537
+ reasonCodes: string[];
2538
+ confidence: CodingLedgerConfidence;
2539
+ calibrationMetadata: CodingLedgerCalibrationMetadata;
2540
+ redaction: CodingLedgerRedactionSummary;
2541
+ caveats: string[];
2542
+ }
2543
+ interface CodingLedgerBuildOptions {
2544
+ input?: unknown;
2545
+ fromFile?: string;
2546
+ dir?: string;
2547
+ now?: Date;
2548
+ task?: string;
2549
+ prompt?: string;
2550
+ sourceRef?: string;
2551
+ branch?: string;
2552
+ commit?: string;
2553
+ changedFiles?: string[];
2554
+ recentFiles?: string[];
2555
+ diffSummary?: string;
2556
+ servedContext?: string[];
2557
+ plan?: string[];
2558
+ diff?: string[];
2559
+ test?: string[];
2560
+ ci?: string[];
2561
+ review?: string[];
2562
+ outcome?: string[];
2563
+ influenceReceipt?: string[];
2564
+ reasonCode?: string[];
2565
+ confidence?: string;
2566
+ calibration?: string[];
2567
+ }
2568
+ interface CodingLedgerExportCommandOptions extends CodingLedgerBuildOptions {
2569
+ output?: string;
2570
+ json?: boolean;
2571
+ }
2572
+ declare function buildCodingIntelligenceLedger(options?: CodingLedgerBuildOptions): CodingIntelligenceLedger;
2573
+ declare function codingLedgerExportCommand(options: CodingLedgerExportCommandOptions): Promise<void>;
2574
+
2369
2575
  declare const TEAM_SYNC_STATE_RELATIVE_PATH: string;
2370
2576
  type TeamSyncAttention = "note" | "watch" | "review" | "proof";
2371
2577
  type TeamSyncWorkStatus = "active" | "completed" | "archived";
@@ -2497,7 +2703,9 @@ interface AgenticHandoffAdapterPack {
2497
2703
  target: {
2498
2704
  id: AgenticHandoffAdapterTarget;
2499
2705
  label: string;
2706
+ profile: string;
2500
2707
  instruction: string;
2708
+ runtimeControl: "handoff_only";
2501
2709
  };
2502
2710
  contextPack: {
2503
2711
  summary: string;
@@ -3744,4 +3952,4 @@ declare function buildOrchestratorHandoff(options: OrchestratorHandoffOptions):
3744
3952
  declare function buildAdaptiveWorkRoutingRecommendation(options: AdaptiveWorkRoutingOptions): AdaptiveWorkRoutingRecommendation;
3745
3953
  declare function writeOrchestratorHandoff(options: OrchestratorHandoffOptions): WrittenOrchestratorHandoff;
3746
3954
 
3747
- 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, addLocalWorker, 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, readLocalWorkersConfig, referencesIngestCommand, referencesScanCommand, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveLocalWorkerRoutingDefaults, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workersLocalAddCommand, workersLocalStatusCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff };
3955
+ export { AUTOMATION_MANIFEST_RELATIVE_PATH, AutomationInstallConflictError, AutomationUnsupportedHookBundleError, CODING_INTELLIGENCE_LEDGER_VERSION, 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, WHY_OUTCOME_CAPTURE_VERSION, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, addLocalWorker, agentReadinessAuditCommand, archiveInactiveTeamSyncWork, attachLocalContextPackReceipts, autoArchiveTeamSyncState, buildAdaptiveWorkRoutingRecommendation, buildAgentReadinessAuditReport, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildCodingIntelligenceLedger, buildCollaborationActor, buildCollaborationGuardActionCards, buildCollaborationHooksInstallPlan, buildCompanionEngineeringLeadPlanReport, buildContextPackStats, buildEvalCaseArtifact, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalProjectRealityCheck, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapQuality, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWhyOutcomeCaptureReport, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, codingLedgerExportCommand, 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, outcomeCapturePreviewCommand, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readLocalCodeOverlayCache, readLocalCodePromotionState, readLocalSourceSnapshot, readLocalWorkersConfig, realityCheckCommand, referencesIngestCommand, referencesScanCommand, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveLocalWorkerRoutingDefaults, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workersLocalAddCommand, workersLocalStatusCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff };