snipara-companion 3.2.1 → 3.2.3

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
@@ -46,6 +46,7 @@ These commands are useful without hosted Snipara:
46
46
  | `reality-check` | Intent Ledger, Unknown Registry, and verification checks |
47
47
  | `code callers` / `imports` / `neighbors` / `shortest-path` | Structural repo questions from local files |
48
48
  | `workflow start` / `phase-start` / `phase-commit` / `resume` | Agent continuity that survives compaction |
49
+ | `workflow timeline` / `workflow session` | Append-only local activity log and Session Snapshot V0 |
49
50
  | `workflow decisions` / `workflow decide` | Local human decision requests and response receipts |
50
51
  | `workflow producer-triage` | Ask for human review of unreviewed Producer Loop samples |
51
52
  | `workflow producer-report` | Local Producer Loop adoption and calibration report |
@@ -69,6 +70,9 @@ npx -y snipara-companion workflow phase-commit audit --summary "mapped auth impa
69
70
  npx -y snipara-companion workflow producer-triage
70
71
  npx -y snipara-companion workflow decisions
71
72
  npx -y snipara-companion workflow decide decision-abc123 --choose accept_all --reviewer alice
73
+ npx -y snipara-companion workflow timeline
74
+ npx -y snipara-companion workflow timeline --export md
75
+ npx -y snipara-companion workflow session --json
72
76
  npx -y snipara-companion workflow producer-report
73
77
  npx -y snipara-companion workflow producer-review --latest --outcome useful --reviewer alice
74
78
  npx -y snipara-companion handoff --summary "auth impact mapped" --next "run auth tests"
@@ -78,7 +82,19 @@ npx -y snipara-companion handoff --summary "auth impact mapped" --next "run auth
78
82
  resume with the current phase, recent handoffs, timeline, context packs, and
79
83
  verification hints.
80
84
 
81
- Workflow `phase-commit` and `final-commit` also emit Producer Loop V0 artifacts
85
+ `workflow timeline` reads the append-only activity log at
86
+ `.snipara/activity/timeline.jsonl`. `workflow session` derives
87
+ `.snipara/activity/session.json` for fast local resume and Orchestrator dogfood;
88
+ Session Snapshot V0 includes latest activity, risk reasons, touched files, a
89
+ next action, and advisory Intent Detection V0. Intent Detection V0 reports the
90
+ inferred intent, confidence, reason-code signals, local evidence counts, and a
91
+ suggested workflow mode hint for the human or agent to consider. It is
92
+ observational and keeps `hardRoutingAllowed=false` until explicit routing policy
93
+ and receipts exist.
94
+ `workflow timeline --export md` prints a compact redacted Markdown timeline for
95
+ handoff or publication.
96
+
97
+ Workflow `phase-commit` and `final-commit` also emit Producer Loop artifacts
82
98
  under `.snipara/producer-loop/`. These are local review evidence backed by the
83
99
  redacted Coding Intelligence Ledger, not automatic durable memory, worker
84
100
  execution, calibrated confidence, or server-side attestation. Use
@@ -92,19 +108,24 @@ Use `workflow producer-review --artifact <path|file|artifactId>` or
92
108
  `workflow producer-review --latest` after auditing embedded evidence to move a
93
109
  sample from `sample_unreviewed` to `sample_reviewed` or `sample_rejected`.
94
110
  For conversational human review, run `workflow producer-triage` to create a
95
- batched Decision Request V0 artifact, `workflow decisions --json` to give the
111
+ batched Decision Request artifact, `workflow decisions --json` to give the
96
112
  LLM client the exact question/evidence/options to ask, and `workflow decide`
97
113
  only after the human answers. Batched requests include readable evidence items
98
114
  with artifact summaries, statuses, file hints, and metadata instead of only
99
115
  opaque refs. Decision requests never resolve by timeout or default, and only
100
116
  `workflow decide` applies the existing `producer-review` path.
117
+ When repeated resolved receipts share the same human choice and rationale,
118
+ `workflow decide` may emit a new review-only policy suggestion decision request;
119
+ it still uses manual apply instructions and never writes policy automatically.
101
120
  Other producers such as `outcome-capture preview --emit-decisions`,
102
121
  `memory reviews --emit-decisions`, `workflow decision-producer memory`, and
103
122
  `workflow decision-producer context-risk` emit requests with their existing apply
104
123
  paths declared; they do not write canonical memory directly. `memory reviews`
105
124
  is the hosted-memory review connector: it reads review queue, cleanup, and
106
125
  duplicate candidate surfaces, summarizes the items for the LLM, and only writes
107
- local Decision Requests when `--emit-decisions` is passed.
126
+ local Decision Requests when `--emit-decisions` is passed. Its JSON output
127
+ includes `emittedCount`, `emittedRequestIds`, and an `emitted` summary so an
128
+ agent can continue without re-listing pending requests.
108
129
 
109
130
  ## Local First, Hosted When Useful
110
131
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { ProjectRealityCheckResult, ProjectIntelligenceEngineeringLeadPlanSummary } from '@snipara/project-intelligence-contracts';
2
+ import { ProjectIntentDetectionResult, ProjectRealityCheckResult, ProjectIntelligenceEngineeringLeadPlanSummary } from '@snipara/project-intelligence-contracts';
3
3
 
4
4
  declare function resolveQueryFromToolInput(toolInput?: string, tool?: string): string | null;
5
5
 
@@ -1505,6 +1505,113 @@ declare function getStagedFiles(root: string): string[];
1505
1505
  */
1506
1506
  declare function runMemoryGuardCheck(options?: MemoryGuardCheckOptions): Promise<MemoryGuardCheckResult>;
1507
1507
 
1508
+ declare const ACTIVITY_TIMELINE_VERSION: "snipara.activity_timeline.v0";
1509
+ declare const SESSION_SNAPSHOT_VERSION: "snipara.session_snapshot.v0";
1510
+ type ActivityEventSource = "workflow" | "team-sync" | "decision" | "producer-loop" | "journal" | "orchestrator";
1511
+ interface ActivityTimelineEvent {
1512
+ schemaVersion: typeof ACTIVITY_TIMELINE_VERSION;
1513
+ eventId: string;
1514
+ timestamp: string;
1515
+ source: ActivityEventSource;
1516
+ kind: string;
1517
+ title: string;
1518
+ summary?: string;
1519
+ workflowId?: string;
1520
+ phaseId?: string;
1521
+ actor?: string;
1522
+ outcome?: string;
1523
+ files: string[];
1524
+ refs: string[];
1525
+ metadata: Record<string, unknown>;
1526
+ }
1527
+ interface SessionSnapshot {
1528
+ schemaVersion: typeof SESSION_SNAPSHOT_VERSION;
1529
+ generatedAt: string;
1530
+ source: {
1531
+ cwd: string;
1532
+ timelinePath: string;
1533
+ snapshotPath: string;
1534
+ };
1535
+ workflow: {
1536
+ id?: string;
1537
+ goal?: string;
1538
+ status?: string;
1539
+ currentPhaseId?: string;
1540
+ currentPhaseTitle?: string;
1541
+ } | null;
1542
+ activity: {
1543
+ totalEvents: number;
1544
+ latestEventAt?: string;
1545
+ latestEvents: ActivityTimelineEvent[];
1546
+ countsBySource: Record<string, number>;
1547
+ countsByKind: Record<string, number>;
1548
+ };
1549
+ decisions: {
1550
+ pendingCount: number;
1551
+ resolvedCount: number;
1552
+ recurringResolvedFingerprintCount: number;
1553
+ };
1554
+ producerLoop: {
1555
+ artifactCount: number;
1556
+ reviewedCount: number;
1557
+ rejectedCount: number;
1558
+ unreviewedCount: number;
1559
+ hardGateReady: false;
1560
+ };
1561
+ teamSync: {
1562
+ activeWorkCount: number;
1563
+ handoffCount: number;
1564
+ latestHandoffAt?: string;
1565
+ };
1566
+ summary: {
1567
+ latestActivityAt?: string;
1568
+ latestActivityTitle?: string;
1569
+ latestActivityKind?: string;
1570
+ risk: "none" | "watch" | "risk";
1571
+ riskReasons: string[];
1572
+ touchedFiles: string[];
1573
+ recommendedNextAction: string;
1574
+ };
1575
+ intentDetection: ProjectIntentDetectionResult;
1576
+ routing: {
1577
+ hardRoutingAllowed: false;
1578
+ reason: string;
1579
+ };
1580
+ performance: {
1581
+ buildMs: number;
1582
+ };
1583
+ caveats: string[];
1584
+ }
1585
+ interface AppendActivityInput {
1586
+ source: ActivityEventSource;
1587
+ kind: string;
1588
+ title: string;
1589
+ summary?: string;
1590
+ workflowId?: string;
1591
+ phaseId?: string;
1592
+ actor?: string;
1593
+ outcome?: string;
1594
+ files?: string[];
1595
+ refs?: string[];
1596
+ metadata?: Record<string, unknown>;
1597
+ timestamp?: string;
1598
+ cwd?: string;
1599
+ }
1600
+ declare function appendActivityEvent(input: AppendActivityInput): ActivityTimelineEvent;
1601
+ declare function readActivityTimeline(options?: {
1602
+ cwd?: string;
1603
+ limit?: number;
1604
+ }): ActivityTimelineEvent[];
1605
+ declare function buildSessionSnapshot(options?: {
1606
+ cwd?: string;
1607
+ limit?: number;
1608
+ }): SessionSnapshot;
1609
+ declare function writeSessionSnapshot(options?: {
1610
+ cwd?: string;
1611
+ limit?: number;
1612
+ }): SessionSnapshot;
1613
+ declare function readSessionSnapshot(cwd?: string): SessionSnapshot | null;
1614
+
1508
1615
  type LocalCodeOverlayMode = "working_tree" | "local_commit";
1509
1616
  type LocalCodeOverlayKind = "none" | "local_commit" | "working_tree" | "mixed";
1510
1617
  interface LocalCodeOverlayOptions {
@@ -1921,6 +2028,7 @@ interface ProjectIntelligenceBrief {
1921
2028
  memoryHealth?: Record<string, unknown>;
1922
2029
  codeImpact?: Record<string, unknown>;
1923
2030
  codeImpactSourceSelection?: CodeGraphSourceSelection;
2031
+ localSessionSnapshot?: SessionSnapshot;
1924
2032
  verificationPlan?: VerificationPlan;
1925
2033
  judgmentCard?: ProjectIntelligenceJudgmentCard;
1926
2034
  errors: Array<{
@@ -3013,10 +3121,10 @@ interface AgenticWorkStatus {
3013
3121
  }
3014
3122
  interface AgenticTimelineEvent {
3015
3123
  time: string;
3016
- kind: "workflow-start" | "phase-start" | "phase-commit" | "final-commit" | "team-sync-start" | "team-sync-complete" | "team-sync-handoff";
3124
+ kind: string;
3017
3125
  title: string;
3018
3126
  detail?: string;
3019
- source: "workflow" | "team-sync";
3127
+ source: ActivityEventSource;
3020
3128
  files?: string[];
3021
3129
  }
3022
3130
  interface AgenticTimeline {
@@ -4116,4 +4224,4 @@ declare function buildOrchestratorHandoff(options: OrchestratorHandoffOptions):
4116
4224
  declare function buildAdaptiveWorkRoutingRecommendation(options: AdaptiveWorkRoutingOptions): AdaptiveWorkRoutingRecommendation;
4117
4225
  declare function writeOrchestratorHandoff(options: OrchestratorHandoffOptions): WrittenOrchestratorHandoff;
4118
4226
 
4119
- 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, PRODUCER_LOOP_ARTIFACT_VERSION, PRODUCER_LOOP_RELATIVE_DIR, PRODUCER_LOOP_REPORT_VERSION, 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, buildProducerLoopReport, 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, memoryReviewsCommand, 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, writeProducerLoopArtifact };
4227
+ 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, PRODUCER_LOOP_ARTIFACT_VERSION, PRODUCER_LOOP_RELATIVE_DIR, PRODUCER_LOOP_REPORT_VERSION, TEAM_SYNC_STATE_RELATIVE_PATH, WHY_OUTCOME_CAPTURE_VERSION, WORKFLOW_PLANS_RELATIVE_DIR, WORKFLOW_STATE_RELATIVE_PATH, addLocalWorker, agentReadinessAuditCommand, appendActivityEvent, 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, buildProducerLoopReport, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapQuality, buildSessionSnapshot, 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, memoryReviewsCommand, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, outcomeCapturePreviewCommand, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readActivityTimeline, readLocalCodeOverlayCache, readLocalCodePromotionState, readLocalSourceSnapshot, readLocalWorkersConfig, readSessionSnapshot, 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, writeProducerLoopArtifact, writeSessionSnapshot };