snipara-companion 3.6.3 → 3.6.5

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,25 @@
2
2
 
3
3
  Release notes for `snipara-companion`, newest first.
4
4
 
5
+ ## New In 3.6.5
6
+
7
+ - Adds a local `agent-context` manifest and resolver for composing shared
8
+ organization, shared project, and role-specific context without cross-role
9
+ document leakage.
10
+ - Keeps new memory writes agent-local by default and exposes only explicitly
11
+ allowed, human-reviewed project or team promotion targets.
12
+ - Ships Snipara's first dogfood profiles for lead, code, review, and security
13
+ agents without adding a database scope or changing hosted authorization.
14
+
15
+ ## New In 3.6.4
16
+
17
+ - Correlates hosted Judgment responses with their immutable snapshot, append-only
18
+ exposure, run, and served-Judgment identities.
19
+ - Sends those canonical identities back with advisor influence receipts so the
20
+ backend can reject mismatched client correlation data.
21
+ - Keeps hosted Judgment failures best-effort for local runs while reporting the
22
+ failure boundary explicitly.
23
+
5
24
  ## New In 3.6.3
6
25
 
7
26
  - Labels every semantic `confidence` value as an uncalibrated
package/README.md CHANGED
@@ -105,11 +105,34 @@ These commands are useful without hosted Snipara:
105
105
  | `workflow producer-report` | Local Producer Loop adoption and calibration report |
106
106
  | `workflow producer-review` | Mark local Producer Loop samples reviewed or rejected |
107
107
  | `context-control plan` / `apply` / `drift` / `validate` / `hosted-*` | Review local state and reconcile Context as Code with hosted project context |
108
+ | `agent-context validate` / `resolve` | Compile shared plus role-specific context and safe memory policy |
108
109
  | `context-pack` | Reversible local packs for long logs, diffs, and tool output |
109
110
  | `judgment-card`, `verify`, `lead-plan`, `agent-readiness` | Local review artifacts and delegation contracts |
110
111
  | `intelligence ledger-export` | Structured redacted ledger JSON for replay and review |
111
112
  | `stuck-guard`, `memory-guard`, `pre-tool`, `post-tool` | Fail-soft local guards and hook helpers |
112
113
 
114
+ ### Agent Context Dogfood
115
+
116
+ `agent-context` compiles one agent's working context from a versioned local
117
+ manifest. It layers company truth, project truth, and only the roles assigned to
118
+ that agent. The resolver also prints the exact memory recalls, agent-local
119
+ default write target, and review-gated promotion targets.
120
+
121
+ ```bash
122
+ npx -y snipara-companion agent-context validate \
123
+ --manifest snipara.agent-context.json
124
+
125
+ npx -y snipara-companion agent-context resolve \
126
+ --agent snipara-code \
127
+ --task "implement the next bounded change"
128
+ ```
129
+
130
+ Use `--json` when another agent runtime will consume the resolution. This local
131
+ command plans retrieval; it does not read the source documents or call Hosted
132
+ MCP on the agent's behalf. Role memory is represented by exact categories in
133
+ the existing project or team scopes, so the V0 dogfood flow needs no database
134
+ migration.
135
+
113
136
  ### Context Control
114
137
 
115
138
  `context-control` is the local trust layer for Project Intelligence state. It
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { AdvisorInfluenceLifecycle, HostedContextControlSource, HostedContextControlPlan, HostedContextControlApplyReceipt, ProjectIntentDetectionResult, ProjectPolicyDecision, ProjectRealityCheckResult, ContextMutationPlan, ContextMutationApplyReceipt, ProjectContextValidationReport, ProjectDriftReport, ProjectIntelligenceEngineeringLeadPlanSummary, ProjectPolicyRule, DecisionRequest, AdvisorInfluenceLifecycleState, OutcomeIntelligenceCalibration, OutcomeIntelligenceReceipt, ControlledWorkerExecutionMode, WorkerTrustCategory, ControlledWorkerExecutionReceipt, UnifiedReceiptEnvelope, WorkerTrustCandidate, WorkerProfile, WorkerTrustEvent } from '@snipara/project-intelligence-contracts';
2
+ import { AdvisorInfluenceLifecycle, HostedContextControlSource, HostedContextControlPlan, HostedContextControlApplyReceipt, ProjectIntentDetectionResult, ProjectPolicyDecision, ProjectRealityCheckResult, ContextMutationPlan, ContextMutationApplyReceipt, ProjectContextValidationReport, ProjectDriftReport, AgentContextResolution, AgentContextValidationReport, ProjectIntelligenceEngineeringLeadPlanSummary, ProjectPolicyRule, DecisionRequest, AdvisorInfluenceLifecycleState, OutcomeIntelligenceCalibration, OutcomeIntelligenceReceipt, ControlledWorkerExecutionMode, WorkerTrustCategory, ControlledWorkerExecutionReceipt, UnifiedReceiptEnvelope, WorkerTrustCandidate, WorkerProfile, WorkerTrustEvent } from '@snipara/project-intelligence-contracts';
3
3
 
4
4
  declare function resolveQueryFromToolInput(toolInput?: string, tool?: string): string | null;
5
5
 
@@ -688,6 +688,9 @@ interface AdvisorInfluenceRecommendationInput {
688
688
  }
689
689
  interface RecordAdvisorInfluenceReceiptInput {
690
690
  servedJudgmentId: string;
691
+ judgmentSnapshotId?: string;
692
+ judgmentExposureId?: string;
693
+ runId?: string;
691
694
  recommendation: AdvisorInfluenceRecommendationInput;
692
695
  agentDecision: AdvisorInfluenceAgentDecision;
693
696
  behaviorChange: string;
@@ -725,6 +728,16 @@ interface ProjectIntelligenceBriefRequest {
725
728
  changedFiles?: string[];
726
729
  symbols?: string[];
727
730
  routes?: string[];
731
+ codeContext?: {
732
+ localHeadSha?: string;
733
+ branch?: string;
734
+ workingTreeDirty?: boolean;
735
+ };
736
+ correlation?: {
737
+ surface?: "companion";
738
+ runId?: string;
739
+ sessionId?: string;
740
+ };
728
741
  }
729
742
  interface HostedProjectIntelligenceBriefResult {
730
743
  project: {
@@ -733,6 +746,8 @@ interface HostedProjectIntelligenceBriefResult {
733
746
  slug: string;
734
747
  };
735
748
  servedJudgmentId: string | null;
749
+ judgmentSnapshotId: string | null;
750
+ judgmentExposureId: string | null;
736
751
  persistedShadowSignalCount: number;
737
752
  brief: {
738
753
  version: string;
@@ -2473,6 +2488,27 @@ declare function contextControlValidateCommand(options: ContextControlValidateCo
2473
2488
  declare function contextControlHostedDiffCommand(options: ContextControlHostedDiffCommandOptions): Promise<void>;
2474
2489
  declare function contextControlHostedApplyCommand(options: ContextControlHostedApplyCommandOptions): Promise<void>;
2475
2490
 
2491
+ interface AgentContextValidateCommandOptions {
2492
+ manifest?: string;
2493
+ json?: boolean;
2494
+ cwd?: string;
2495
+ }
2496
+ interface AgentContextResolveCommandOptions {
2497
+ manifest?: string;
2498
+ agent: string;
2499
+ task: string;
2500
+ json?: boolean;
2501
+ cwd?: string;
2502
+ }
2503
+ declare function buildLocalAgentContextValidationReport(options: {
2504
+ cwd?: string;
2505
+ manifest: unknown;
2506
+ generatedAt?: string | Date;
2507
+ }): AgentContextValidationReport;
2508
+ declare function formatAgentContextResolution(resolution: AgentContextResolution): string;
2509
+ declare function agentContextValidateCommand(options?: AgentContextValidateCommandOptions): Promise<AgentContextValidationReport>;
2510
+ declare function agentContextResolveCommand(options: AgentContextResolveCommandOptions): Promise<AgentContextResolution>;
2511
+
2476
2512
  interface MemoryHealthCommandOptions {
2477
2513
  scope?: MemoryScope;
2478
2514
  includeInactive?: boolean;
@@ -2933,6 +2969,8 @@ interface ProjectRunHostedJudgmentLink {
2933
2969
  status: "linked" | "unlinked" | "unavailable";
2934
2970
  timeoutMs: number;
2935
2971
  servedJudgmentId?: string;
2972
+ judgmentSnapshotId?: string;
2973
+ judgmentExposureId?: string;
2936
2974
  error?: string;
2937
2975
  }
2938
2976
  interface ProjectIntelligenceRunResult {
@@ -5157,4 +5195,4 @@ declare function installAutomationBundle(args: {
5157
5195
  }): Promise<AutomationInstallResult>;
5158
5196
  declare function getAutomationStatus(projectDir?: string): AutomationStatusResult;
5159
5197
 
5160
- 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, FINAL_COMMIT_REPORT_RELATIVE_PATH, FINAL_COMMIT_REPORT_VERSION, MEMORY_GUARD_CONTEXT_TIMEOUT_MS, MEMORY_GUARD_RECALL_TIMEOUT_MS, 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, buildFinalCommitReport, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextMutationPlan, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalProjectContextValidationReport, buildLocalProjectDriftReport, buildLocalProjectRealityCheck, buildLocalProjectRealityCheckWithAutoContext, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildPolicyLedgerSyncReport, buildProducerLoopReport, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapBrief, buildSessionBootstrapQuality, buildSessionSnapshot, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWhyOutcomeCaptureReport, buildWorkerTrustCandidates, buildWorkflowImpactGate, buildWorkflowPhaseCommitReceipt, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, codingLedgerExportCommand, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectPolicyLedgerSyncArtifacts, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextControlApplyCommand, contextControlDriftCommand, contextControlHostedApplyCommand, contextControlHostedDiffCommand, contextControlPlanCommand, contextControlValidateCommand, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, controlledWorkerExecuteCommand, createClient, createEmptyCollaborationState, createEmptyTeamSyncState, createLocalQueryCache, deriveLocalCollaborationResourcesFromFiles, detectReleaseSurfacesFromFiles, detectRuntimeEnvironment, evalExportCommand, evalRunCommand, evaluateProjectPolicyGates, extractCommandFromToolInput, extractFilesFromToolInput, formatAgentReadinessAuditReport, formatCompanionEngineeringLeadPlanReport, formatFinalCommitReport, formatOrchestratorRecommendationReason, formatPolicyGateDecision, formatProjectJudgmentCard, formatStuckGuardDecision, getAutomationManifestPath, getAutomationStatus, getCollaborationStatePath, getConfigPath, getContextPackStoragePaths, getLocalCodeOverlayCachePath, getLocalCodePromotionStatePath, getLocalSourceSnapshotPath, getOrchestratorRecommendation, getPlanStepDisplayTitle, getStagedFiles, getStuckGuardInjection, getTeamSyncStatePath, hashWorkerProfile, ingestReferences, installAutomationBundle, leadPlanCommand, listProjectsForApiKey, loadAutomationManifest, loadCollaborationState, loadConfig, loadTeamSyncState, memoryAuditCommand, memoryCleanCandidatesCommand, memoryCompactCommand, memoryHealthCommand, memoryLocalCommand, memoryReviewsCommand, mergeHybridCodeResults, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, outcomeCapturePreviewCommand, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readActivityTimeline, readLocalCodeOverlayCache, readLocalCodePromotionState, readLocalSourceSnapshot, readLocalWorkersConfig, readSessionSnapshot, readWorkerTrustEvent, realityCheckCommand, referencesIngestCommand, referencesScanCommand, resolveAutoWorkflowMode, resolveCodeGraphMode, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveLocalWorkerRoutingDefaults, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldFailCollaborationGuard, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workerTrustCandidateCommand, workerTrustReviewCommand, workerTrustStatusCommand, workersLocalAddCommand, workersLocalListCommand, workersLocalProbePrintCommand, workersLocalRemoveCommand, workersLocalStatusCommand, workflowSyncPolicyLedgerCommand, writeFinalCommitReport, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff, writeProducerLoopArtifact, writeSessionSnapshot };
5198
+ 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, FINAL_COMMIT_REPORT_RELATIVE_PATH, FINAL_COMMIT_REPORT_VERSION, MEMORY_GUARD_CONTEXT_TIMEOUT_MS, MEMORY_GUARD_RECALL_TIMEOUT_MS, 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, agentContextResolveCommand, agentContextValidateCommand, 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, buildFinalCommitReport, buildGeneratedWorkflowPlanDocument, buildHostedCodeOverlayUploadPayload, buildHostedGuardPayload, buildJournalCheckpointEntry, buildLocalAgentContextValidationReport, buildLocalCallersResult, buildLocalCodeOverlay, buildLocalContextMutationPlan, buildLocalContextPackReceipt, buildLocalContextPackReceipts, buildLocalImpactResult, buildLocalImportsResult, buildLocalNeighborsResult, buildLocalProjectContextValidationReport, buildLocalProjectDriftReport, buildLocalProjectRealityCheck, buildLocalProjectRealityCheckWithAutoContext, buildLocalShortestPathResult, buildLocalSourceSnapshot, buildLocalSourceStatus, buildLocalSourceSyncResult, buildMemoryAudit, buildOnboardFolderManifest, buildOrchestratorHandoff, buildPolicyLedgerSyncReport, buildProducerLoopReport, buildProjectIntelligenceBrief, buildProjectIntelligenceRun, buildProjectJudgmentCard, buildSessionBootstrapBrief, buildSessionBootstrapQuality, buildSessionSnapshot, buildSyncDocumentsDryRun, buildTeamSyncHandoffRecord, buildTeamSyncStartWorkRecord, buildTeamSyncSummary, buildToolCallPayload, buildToolResultPayload, buildVerificationPlan, buildWhyOutcomeCaptureReport, buildWorkerTrustCandidates, buildWorkflowImpactGate, buildWorkflowPhaseCommitReceipt, buildWorkflowPhaseCommitSummary, buildWorkflowPlanScaffold, categoryFromGuardTag, classifyToolResult, cleanContextPacks, codingLedgerExportCommand, collaborationIdeStatusCommand, collectAgentReadinessLocalSignals, collectPolicyLedgerSyncArtifacts, collectSyncDocuments, collectSyncDocumentsInput, compactHostedGuardResources, compareLocalSourceSnapshots, completeTeamSyncStateFromEvidence, completeTeamSyncWorkFromEvidence, contextControlApplyCommand, contextControlDriftCommand, contextControlHostedApplyCommand, contextControlHostedDiffCommand, contextControlPlanCommand, contextControlValidateCommand, contextPackCleanCommand, contextPackPackCommand, contextPackRetrieveCommand, contextPackStatsCommand, controlledWorkerExecuteCommand, createClient, createEmptyCollaborationState, createEmptyTeamSyncState, createLocalQueryCache, deriveLocalCollaborationResourcesFromFiles, detectReleaseSurfacesFromFiles, detectRuntimeEnvironment, evalExportCommand, evalRunCommand, evaluateProjectPolicyGates, extractCommandFromToolInput, extractFilesFromToolInput, formatAgentContextResolution, formatAgentReadinessAuditReport, formatCompanionEngineeringLeadPlanReport, formatFinalCommitReport, formatOrchestratorRecommendationReason, formatPolicyGateDecision, formatProjectJudgmentCard, formatStuckGuardDecision, getAutomationManifestPath, getAutomationStatus, getCollaborationStatePath, getConfigPath, getContextPackStoragePaths, getLocalCodeOverlayCachePath, getLocalCodePromotionStatePath, getLocalSourceSnapshotPath, getOrchestratorRecommendation, getPlanStepDisplayTitle, getStagedFiles, getStuckGuardInjection, getTeamSyncStatePath, hashWorkerProfile, ingestReferences, installAutomationBundle, leadPlanCommand, listProjectsForApiKey, loadAutomationManifest, loadCollaborationState, loadConfig, loadTeamSyncState, memoryAuditCommand, memoryCleanCandidatesCommand, memoryCompactCommand, memoryHealthCommand, memoryLocalCommand, memoryReviewsCommand, mergeHybridCodeResults, normalizeCollaborationFiles, normalizeGuardTag, normalizeWorkflowPlanInput, outcomeCapturePreviewCommand, packContext, parseCollaborationResources, projectIntelligenceBriefCommand, projectIntelligenceRunCommand, readActivityTimeline, readLocalCodeOverlayCache, readLocalCodePromotionState, readLocalSourceSnapshot, readLocalWorkersConfig, readSessionSnapshot, readWorkerTrustEvent, realityCheckCommand, referencesIngestCommand, referencesScanCommand, resolveAutoWorkflowMode, resolveCodeGraphMode, resolveContextPackRecord, resolveFullWorkflowTokenBudget, resolveLocalWorkerRoutingDefaults, resolveQueryFromToolInput, retrieveContextPack, runMemoryGuardCheck, saveCollaborationState, saveConfig, saveTeamSyncState, scanReferences, shouldFailCollaborationGuard, shouldSuggestOrchestratorForWorkflow, shouldSuggestRuntimeForWorkflow, summarizeLocalCodeOverlay, teamSyncSweepCommand, validatePlanResult, verifyCommand, workerTrustCandidateCommand, workerTrustReviewCommand, workerTrustStatusCommand, workersLocalAddCommand, workersLocalListCommand, workersLocalProbePrintCommand, workersLocalRemoveCommand, workersLocalStatusCommand, workflowSyncPolicyLedgerCommand, writeFinalCommitReport, writeLocalCodeOverlayCache, writeLocalCodePromotionState, writeLocalSourceSnapshot, writeOrchestratorHandoff, writeProducerLoopArtifact, writeSessionSnapshot };