snipara-companion 3.4.1 → 3.5.0

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,13 @@
2
2
 
3
3
  Release notes for `snipara-companion`, newest first.
4
4
 
5
+ ## New In 3.5.0
6
+
7
+ - Adds an explicit `workflow run --strong-repair` handoff contract for one
8
+ bounded strong-adapter repair after local proof or output failure.
9
+ - Keeps Companion recommendation-only: it records final authority, proof,
10
+ scope, and `main_agent` fallback without silently launching workers.
11
+
5
12
  ## New In 3.4.1
6
13
 
7
14
  - Declares provider API keys by environment-variable name and supports
package/dist/index.d.ts CHANGED
@@ -3238,6 +3238,14 @@ interface AdaptiveRoutingResolution {
3238
3238
  warnings?: string[];
3239
3239
  rejectedReasons?: Record<string, string[]>;
3240
3240
  }
3241
+ interface AdaptiveStrongRepairContract {
3242
+ enabled: boolean;
3243
+ maxAttempts: 1;
3244
+ finalAuthority: "strong_adapter";
3245
+ proofRequired: true;
3246
+ scopePreserved: true;
3247
+ fallback: "main_agent";
3248
+ }
3241
3249
  interface AdaptiveWorkRoutingRecommendation {
3242
3250
  workProfile: AdaptiveWorkProfile;
3243
3251
  requirements: AdaptiveModelRequirements;
@@ -3245,6 +3253,7 @@ interface AdaptiveWorkRoutingRecommendation {
3245
3253
  gateway?: AdaptiveRoutingGatewayStatus;
3246
3254
  runtimeCatalog?: AdaptiveRoutingRuntimeCatalog;
3247
3255
  resolution?: AdaptiveRoutingResolution;
3256
+ strongRepair?: AdaptiveStrongRepairContract;
3248
3257
  }
3249
3258
  interface AdaptiveWorkRoutingOptions {
3250
3259
  query: string;
@@ -3259,6 +3268,7 @@ interface AdaptiveWorkRoutingOptions {
3259
3268
  catalogLimit?: number;
3260
3269
  dailyBudgetCents?: number;
3261
3270
  monthlyBudgetCents?: number;
3271
+ strongRepair?: boolean;
3262
3272
  }
3263
3273
  interface OrchestratorHandoffArtifact {
3264
3274
  schemaVersion: "snipara.orchestrator.handoff.v1";
@@ -3289,6 +3299,7 @@ interface OrchestratorHandoffArtifact {
3289
3299
  gateway?: AdaptiveRoutingGatewayStatus;
3290
3300
  runtimeCatalog?: AdaptiveRoutingRuntimeCatalog;
3291
3301
  resolution?: AdaptiveRoutingResolution;
3302
+ strongRepair?: AdaptiveStrongRepairContract;
3292
3303
  };
3293
3304
  task: {
3294
3305
  title: string;
package/dist/index.js CHANGED
@@ -14207,7 +14207,8 @@ function buildOrchestratorHandoff(options) {
14207
14207
  routingCard: options.adaptiveRouting.routingCard,
14208
14208
  ...options.adaptiveRouting.gateway ? { gateway: options.adaptiveRouting.gateway } : {},
14209
14209
  ...options.adaptiveRouting.runtimeCatalog ? { runtimeCatalog: options.adaptiveRouting.runtimeCatalog } : {},
14210
- ...options.adaptiveRouting.resolution ? { resolution: options.adaptiveRouting.resolution } : {}
14210
+ ...options.adaptiveRouting.resolution ? { resolution: options.adaptiveRouting.resolution } : {},
14211
+ ...options.adaptiveRouting.strongRepair ? { strongRepair: options.adaptiveRouting.strongRepair } : {}
14211
14212
  } : {}
14212
14213
  },
14213
14214
  task: {
@@ -14324,7 +14325,17 @@ function buildAdaptiveWorkRoutingRecommendation(options) {
14324
14325
  return {
14325
14326
  workProfile,
14326
14327
  requirements,
14327
- routingCard
14328
+ routingCard,
14329
+ ...options.strongRepair ? {
14330
+ strongRepair: {
14331
+ enabled: true,
14332
+ maxAttempts: 1,
14333
+ finalAuthority: "strong_adapter",
14334
+ proofRequired: true,
14335
+ scopePreserved: true,
14336
+ fallback: "main_agent"
14337
+ }
14338
+ } : {}
14328
14339
  };
14329
14340
  }
14330
14341
  function inferAdaptiveTaskType(query, changedFiles) {
@@ -25167,6 +25178,10 @@ function printAdaptiveRoutingRecommendation(routing) {
25167
25178
  if (routing.requirements.plannerRetainsReasoning) {
25168
25179
  printKeyValue2("Planner retains reasoning:", "yes");
25169
25180
  }
25181
+ if (routing.strongRepair?.enabled) {
25182
+ printKeyValue2("Strong repair:", "one bounded attempt after proof/output failure");
25183
+ printKeyValue2("Repair authority:", routing.strongRepair.finalAuthority);
25184
+ }
25170
25185
  if (routing.gateway) {
25171
25186
  printKeyValue2(
25172
25187
  routing.gateway.source === "local_orchestrator" ? "Local route:" : "Hosted catalog:",
@@ -27501,7 +27516,7 @@ async function workflowRunCommand(options) {
27501
27516
  }
27502
27517
  function shouldBuildAdaptiveRouting(options) {
27503
27518
  return Boolean(
27504
- options.adaptiveRoutingDryRun || options.routeLocalWorkers || options.routingLocalWorker || options.routingWorkerRole || options.routingPreferredEndpoints?.length || options.routingAllowedEndpoints?.length || options.routingLocalBaseUrl || options.routingLocalModel || options.routingLocalPreferModel || options.routingLocalProvider || options.routingLocalApiKeyEnv || options.plannerRetainsReasoning
27519
+ options.adaptiveRoutingDryRun || options.routeLocalWorkers || options.routingLocalWorker || options.routingWorkerRole || options.routingPreferredEndpoints?.length || options.routingAllowedEndpoints?.length || options.routingLocalBaseUrl || options.routingLocalModel || options.routingLocalPreferModel || options.routingLocalProvider || options.routingLocalApiKeyEnv || options.plannerRetainsReasoning || options.strongRepair
27505
27520
  );
27506
27521
  }
27507
27522
  function buildWorkflowAdaptiveRouting(options, policy = null, intentWarnings = []) {
@@ -27545,6 +27560,7 @@ function buildWorkflowAdaptiveRouting(options, policy = null, intentWarnings = [
27545
27560
  allowedEndpointTypes,
27546
27561
  workerRole,
27547
27562
  plannerRetainsReasoning: options.plannerRetainsReasoning ?? policy?.plannerRetainsReasoning ?? (options.routeLocalWorkers ? true : void 0),
27563
+ strongRepair: options.strongRepair,
27548
27564
  catalogLimit: policy?.catalogLimit ?? DEFAULT_ADAPTIVE_ROUTING_CATALOG_LIMIT,
27549
27565
  dailyBudgetCents: policy?.dailyBudgetCents,
27550
27566
  monthlyBudgetCents: policy?.monthlyBudgetCents
@@ -38959,6 +38975,9 @@ workflow.command("run").description("Run a LITE/STANDARD/FULL/orchestrate workfl
38959
38975
  ).option(
38960
38976
  "--planner-retains-reasoning",
38961
38977
  "Mark the main planner as retaining deep reasoning while the worker executes scoped work"
38978
+ ).option(
38979
+ "--strong-repair",
38980
+ "Allow one bounded strong-adapter repair after local proof or output validation fails"
38962
38981
  ).option("--write-plan-file <file>", "Write the generated FULL-mode plan as workflow JSON").option(
38963
38982
  "--start-workflow-from-plan",
38964
38983
  "Start a local managed workflow from the generated FULL-mode plan"
@@ -38987,6 +39006,7 @@ workflow.command("run").description("Run a LITE/STANDARD/FULL/orchestrate workfl
38987
39006
  routingLocalApiKeyEnv: options.routingLocalApiKeyEnv,
38988
39007
  routingLocalApiKeyHeader: options.routingLocalApiKeyHeader,
38989
39008
  plannerRetainsReasoning: options.plannerRetainsReasoning ? true : void 0,
39009
+ strongRepair: Boolean(options.strongRepair),
38990
39010
  writePlanFile: options.writePlanFile,
38991
39011
  startWorkflowFromPlan: Boolean(options.startWorkflowFromPlan),
38992
39012
  workflowId: options.workflowId,
@@ -421,6 +421,7 @@ snipara-companion workflow run \
421
421
  --routing-allowed-endpoint local \
422
422
  --routing-allowed-endpoint cloud \
423
423
  --planner-retains-reasoning \
424
+ --strong-repair \
424
425
  "Update documentation for the new gateway"
425
426
  ```
426
427
 
@@ -523,6 +524,12 @@ routing/handoff contract: Companion resolves the local candidate through
523
524
  `snipara-orchestrator`, records metadata, and leaves execution plus proof review
524
525
  to the supervising agent workflow.
525
526
 
527
+ Add `--strong-repair` when the supervising workflow should permit one strong
528
+ adapter repair after a local proof or output failure. The handoff records the
529
+ contract (`maxAttempts: 1`, same scope and proof, strong adapter as final
530
+ authority, `main_agent` fallback); Companion remains recommendation-only and
531
+ does not launch the worker.
532
+
526
533
  Use Qwen for reflection, architecture, and documentation:
527
534
 
528
535
  ```bash
@@ -576,6 +583,21 @@ snipara-orchestrator host run \
576
583
  --write-scope docs/** --proof "git diff --check" --execute
577
584
  ```
578
585
 
586
+ For a loopback local worker with one explicit strong repair attempt:
587
+
588
+ ```bash
589
+ snipara-orchestrator host run \
590
+ --adapter openai_compatible --base-url http://127.0.0.1:1234 \
591
+ --model local/coder --task "Bounded task" --workspace . \
592
+ --write-scope docs/** --proof "git diff --check" \
593
+ --strong-repair --repair-adapter codex_app_server --execute
594
+ ```
595
+
596
+ The repair reuses the approval envelope when approval is required, reruns the
597
+ same proof, and records redacted repair metrics in the durable host receipt.
598
+ Scope violations, unavailable repair hosts, skipped proof, or a failed repair
599
+ escalate without a retry loop.
600
+
579
601
  Native host proof commands run automatically after dispatch. Use
580
602
  `--no-run-proof` only when a reviewer will validate the receipt; the state then
581
603
  remains `verification_required`. Use `--require-approval` with both an approval
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snipara-companion",
3
- "version": "3.4.1",
3
+ "version": "3.5.0",
4
4
  "description": "Local-first CLI that asks your repo what breaks before an AI coding agent edits it.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {