snipara-companion 3.2.24 → 3.2.25

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  Release notes for `snipara-companion`, newest first.
4
4
 
5
+ ## New In 3.2.25
6
+
7
+ - Adds `snipara-companion context-control plan` and `apply` for local,
8
+ Terraform-style previews of Project Intelligence context mutations. Plans are
9
+ content-hashed, pinned to the current Git base by default, and apply only
10
+ bounded writes under `.snipara/context-control/`.
11
+ - Adds `snipara-companion context-control drift` as a read-only project drift
12
+ report across Git state, managed workflow state, pending Decision Requests,
13
+ saved context-control plans, and ProjectContext manifests.
14
+ - Adds `snipara-companion context-control validate --manifest
15
+ snipara.project-context.json` for Context as Code V0. The JSON manifest
16
+ declares project context sources, tiers, authority, tags, owners, and review
17
+ policies without uploading content or mutating hosted state.
18
+
5
19
  ## New In 3.2.24
6
20
 
7
21
  - Adds a validated full `commitSha` to successful commit, amend, revert, and
package/README.md CHANGED
@@ -88,11 +88,65 @@ These commands are useful without hosted Snipara:
88
88
  | `workflow producer-triage` | Ask for human review of unreviewed Producer Loop samples |
89
89
  | `workflow producer-report` | Local Producer Loop adoption and calibration report |
90
90
  | `workflow producer-review` | Mark local Producer Loop samples reviewed or rejected |
91
+ | `context-control plan` / `apply` / `drift` / `validate` | Preview/apply local context mutations, report drift, and validate manifests |
91
92
  | `context-pack` | Reversible local packs for long logs, diffs, and tool output |
92
93
  | `judgment-card`, `verify`, `lead-plan`, `agent-readiness` | Local review artifacts and delegation contracts |
93
94
  | `intelligence ledger-export` | Structured redacted ledger JSON for replay and review |
94
95
  | `stuck-guard`, `memory-guard`, `pre-tool`, `post-tool` | Fail-soft local guards and hook helpers |
95
96
 
97
+ ### Context Control
98
+
99
+ `context-control` is the local trust layer for Project Intelligence state. It
100
+ borrows Terraform's useful product grammar without copying Terraform: preview a
101
+ bounded context mutation, inspect drift, then apply only the exact reviewed
102
+ plan.
103
+
104
+ ```bash
105
+ npx -y snipara-companion context-control plan \
106
+ --operation write_file \
107
+ --target demo.json \
108
+ --content '{"ok":true}' \
109
+ --summary "record reviewed context state" \
110
+ --output .snipara/context-control/plans/demo.json
111
+
112
+ npx -y snipara-companion context-control apply \
113
+ --plan .snipara/context-control/plans/demo.json
114
+
115
+ npx -y snipara-companion context-control drift
116
+ ```
117
+
118
+ For Context as Code V0, add `snipara.project-context.json` and validate it
119
+ locally:
120
+
121
+ ```json
122
+ {
123
+ "schemaVersion": "snipara.project_context_manifest.v0",
124
+ "sources": [
125
+ {
126
+ "path": "docs/architecture.md",
127
+ "authority": "canonical",
128
+ "tier": "HOT",
129
+ "tags": ["architecture"]
130
+ }
131
+ ],
132
+ "policies": [
133
+ {
134
+ "id": "review-context-changes",
135
+ "description": "Human review required before changing canonical context",
136
+ "reviewRequired": true
137
+ }
138
+ ]
139
+ }
140
+ ```
141
+
142
+ ```bash
143
+ npx -y snipara-companion context-control validate --manifest snipara.project-context.json
144
+ npx -y snipara-companion context-control plan --manifest snipara.project-context.json
145
+ ```
146
+
147
+ The manifest is declarative metadata only. Validation and local reconciliation
148
+ do not upload documents, approve memory, or mutate hosted Snipara state.
149
+
96
150
  ### Local Worker Registry
97
151
 
98
152
  Use `workers local` when you want Companion to route bounded work to a local
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { AdvisorInfluenceLifecycle, ProjectIntentDetectionResult, ProjectPolicyDecision, ProjectRealityCheckResult, ProjectIntelligenceEngineeringLeadPlanSummary, ProjectPolicyRule, DecisionRequest, AdvisorInfluenceLifecycleState, OutcomeIntelligenceCalibration, ControlledWorkerExecutionMode, ControlledWorkerExecutionReceipt, UnifiedReceiptEnvelope } from '@snipara/project-intelligence-contracts';
2
+ import { AdvisorInfluenceLifecycle, ProjectIntentDetectionResult, ProjectPolicyDecision, ProjectRealityCheckResult, ContextMutationPlan, ContextMutationApplyReceipt, ProjectContextValidationReport, ProjectDriftReport, ProjectIntelligenceEngineeringLeadPlanSummary, ProjectPolicyRule, DecisionRequest, AdvisorInfluenceLifecycleState, OutcomeIntelligenceCalibration, ControlledWorkerExecutionMode, ControlledWorkerExecutionReceipt, UnifiedReceiptEnvelope } from '@snipara/project-intelligence-contracts';
3
3
 
4
4
  declare function resolveQueryFromToolInput(toolInput?: string, tool?: string): string | null;
5
5
 
@@ -2116,6 +2116,59 @@ interface RealityCheckCommandOptions {
2116
2116
  declare function buildLocalProjectRealityCheck(options: RealityCheckCommandOptions): ProjectRealityCheckResult;
2117
2117
  declare function realityCheckCommand(options: RealityCheckCommandOptions): Promise<void>;
2118
2118
 
2119
+ interface ContextControlPlanCommandOptions {
2120
+ summary?: string;
2121
+ target?: string;
2122
+ manifest?: string;
2123
+ output?: string;
2124
+ projectId?: string;
2125
+ expiresAt?: string;
2126
+ approvalRequired?: boolean;
2127
+ json?: boolean;
2128
+ }
2129
+ interface ContextControlApplyCommandOptions {
2130
+ plan: string;
2131
+ allowStaleBase?: boolean;
2132
+ json?: boolean;
2133
+ }
2134
+ interface ContextControlDriftCommandOptions {
2135
+ json?: boolean;
2136
+ }
2137
+ interface ContextControlValidateCommandOptions {
2138
+ manifest?: string;
2139
+ json?: boolean;
2140
+ }
2141
+ interface LocalContextMutationPlanResult {
2142
+ plan: ContextMutationPlan;
2143
+ planPath?: string;
2144
+ }
2145
+ interface LocalContextMutationApplyResult {
2146
+ plan: ContextMutationPlan;
2147
+ receipt: ContextMutationApplyReceipt;
2148
+ receiptPath?: string;
2149
+ writtenFiles: string[];
2150
+ }
2151
+ declare function buildLocalProjectContextValidationReport(options?: ContextControlValidateCommandOptions & {
2152
+ cwd?: string;
2153
+ now?: Date;
2154
+ }): ProjectContextValidationReport;
2155
+ declare function buildLocalContextMutationPlan(options?: ContextControlPlanCommandOptions & {
2156
+ cwd?: string;
2157
+ now?: Date;
2158
+ }): LocalContextMutationPlanResult;
2159
+ declare function applyLocalContextMutationPlan(options: ContextControlApplyCommandOptions & {
2160
+ cwd?: string;
2161
+ now?: Date;
2162
+ }): LocalContextMutationApplyResult;
2163
+ declare function buildLocalProjectDriftReport(options?: ContextControlDriftCommandOptions & {
2164
+ cwd?: string;
2165
+ now?: Date;
2166
+ }): ProjectDriftReport;
2167
+ declare function contextControlPlanCommand(options: ContextControlPlanCommandOptions): Promise<void>;
2168
+ declare function contextControlApplyCommand(options: ContextControlApplyCommandOptions): Promise<void>;
2169
+ declare function contextControlDriftCommand(options: ContextControlDriftCommandOptions): Promise<void>;
2170
+ declare function contextControlValidateCommand(options: ContextControlValidateCommandOptions): Promise<void>;
2171
+
2119
2172
  interface DecisionRequestWriteResult {
2120
2173
  status: "written" | "duplicate_pending" | "duplicate_resolved";
2121
2174
  requestId: string;
@@ -4451,4 +4504,4 @@ declare function installAutomationBundle(args: {
4451
4504
  }): Promise<AutomationInstallResult>;
4452
4505
  declare function getAutomationStatus(projectDir?: string): AutomationStatusResult;
4453
4506
 
4454
- 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, POLICY_LEDGER_SYNC_REPORT_VERSION, 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, buildCommitResultMetadata, buildCompanionEngineeringLeadPlanReport, buildContextPackStats, buildEvalCaseArtifact, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalProjectRealityCheck, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildPolicyLedgerSyncReport, buildProducerLoopReport, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapBrief, buildSessionBootstrapQuality, buildSessionSnapshot, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWhyOutcomeCaptureReport, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, codingLedgerExportCommand, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectPolicyLedgerSyncArtifacts, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, controlledWorkerExecuteCommand, 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, resolveAutoWorkflowMode, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveLocalWorkerRoutingDefaults, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldFailCollaborationGuard, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workersLocalAddCommand, workersLocalListCommand, workersLocalProbePrintCommand, workersLocalRemoveCommand, workersLocalStatusCommand, workflowSyncPolicyLedgerCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff, writeProducerLoopArtifact, writeSessionSnapshot };
4507
+ 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, POLICY_LEDGER_SYNC_REPORT_VERSION, 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, applyLocalContextMutationPlan, archiveInactiveTeamSyncWork, attachLocalContextPackReceipts, autoArchiveTeamSyncState, buildAdaptiveWorkRoutingRecommendation, buildAgentReadinessAuditReport, buildAgenticHandoffMarkdown, buildAgenticTimeline, buildAgenticWorkStatus, buildAutomationInstallPlan, buildCanonicalEvent, buildCodeHooksInstallPlan, buildCodePromotionResult, buildCodeStatusResult, buildCodeSyncResult, buildCodingIntelligenceLedger, buildCollaborationActor, buildCollaborationGuardActionCards, buildCollaborationHooksInstallPlan, buildCommitResultMetadata, buildCompanionEngineeringLeadPlanReport, buildContextPackStats, buildEvalCaseArtifact, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextMutationPlan, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalProjectContextValidationReport, buildLocalProjectDriftReport, buildLocalProjectRealityCheck, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildPolicyLedgerSyncReport, buildProducerLoopReport, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapBrief, buildSessionBootstrapQuality, buildSessionSnapshot, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWhyOutcomeCaptureReport, buildWorkflowImpactGate, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, codingLedgerExportCommand, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectPolicyLedgerSyncArtifacts, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextControlApplyCommand, contextControlDriftCommand, contextControlPlanCommand, contextControlValidateCommand, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, controlledWorkerExecuteCommand, 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, resolveAutoWorkflowMode, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveLocalWorkerRoutingDefaults, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldFailCollaborationGuard, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workersLocalAddCommand, workersLocalListCommand, workersLocalProbePrintCommand, workersLocalRemoveCommand, workersLocalStatusCommand, workflowSyncPolicyLedgerCommand, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff, writeProducerLoopArtifact, writeSessionSnapshot };