opencode-swarm 7.168.1 → 7.170.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/.opencode/skills/swarm-pr-feedback/SKILL.md +11 -11
- package/README.md +1 -0
- package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
- package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
- package/dist/ci/evaluate.d.ts +100 -0
- package/dist/ci/index.d.ts +13 -0
- package/dist/ci/quality-checks.d.ts +58 -0
- package/dist/ci/report.d.ts +21 -0
- package/dist/ci/runtime.d.ts +81 -0
- package/dist/cli/{capability-probe-faqefhah.js → capability-probe-pdwwz8gs.js} +1 -1
- package/dist/cli/{coder-settlement-54a3d97g.js → coder-settlement-65zx1bet.js} +12 -12
- package/dist/cli/{config-doctor-vzp6b3ng.js → config-doctor-c30rss1c.js} +2 -2
- package/dist/cli/{core-yynse50x.js → core-8wkbr1tr.js} +5 -2
- package/dist/cli/{curation-policy-mgwv8h2k.js → curation-policy-k74qz9ms.js} +5 -5
- package/dist/cli/{curator-drift-k0zrnm09.js → curator-drift-3ssjr0nx.js} +5 -5
- package/dist/cli/curator-llm-factory-jkjqasfs.js +72 -0
- package/dist/cli/{curator-agdhhzqt.js → curator-pckzk1q4.js} +40 -39
- package/dist/cli/{dispatch-8ks9dyk5.js → dispatch-hwwj3qrb.js} +2 -2
- package/dist/cli/{evidence-summary-service-6mmcekr7.js → evidence-summary-service-4ydcapke.js} +17 -17
- package/dist/cli/{gate-evidence-xqvkqhrk.js → gate-evidence-xwqfky3m.js} +7 -7
- package/dist/cli/guardrail-explain-fe2veh2s.js +73 -0
- package/dist/cli/{guardrail-log-5wa5c77w.js → guardrail-log-z38j69bx.js} +8 -8
- package/dist/cli/{guardrail-reset-dh78tbcf.js → guardrail-reset-mmnzt4mz.js} +40 -39
- package/dist/cli/hive-promoter-68hrw1y1.js +87 -0
- package/dist/cli/{index-gmpmgtzn.js → index-06rbdzqn.js} +5 -5
- package/dist/cli/index-0hgmsyfp.js +92 -0
- package/dist/cli/{index-f1fps3w9.js → index-0xprxg95.js} +7 -7
- package/dist/cli/{index-p612v1mv.js → index-2s7dvzff.js} +200 -51
- package/dist/cli/{index-qthc56c4.js → index-31sqcdsd.js} +4 -4
- package/dist/cli/{index-y85aptep.js → index-3axdtaf0.js} +7 -7
- package/dist/cli/{index-9b2105n0.js → index-3eh2n3dx.js} +2 -2
- package/dist/cli/{index-w1dfkp1q.js → index-3p3y55xg.js} +15 -15
- package/dist/cli/{index-apy1qfj0.js → index-4wc5gfgm.js} +26 -4
- package/dist/cli/{index-d5qf7hvh.js → index-5400m33a.js} +1 -1
- package/dist/cli/{index-qkwtth00.js → index-59fcfpkh.js} +197 -35
- package/dist/cli/{index-j0bxxz9d.js → index-5bbem0ey.js} +8 -8
- package/dist/cli/{index-qwsh0h2g.js → index-5qt9yf5w.js} +4 -4
- package/dist/cli/{index-q1r1cfww.js → index-76qm2c2y.js} +37 -26
- package/dist/cli/{index-qhey6vc3.js → index-7h01bkm6.js} +2 -2
- package/dist/cli/{index-6df6wbvj.js → index-8w1mrvbd.js} +8 -8
- package/dist/cli/{index-8ybjqg51.js → index-9ttqbhvw.js} +1 -1
- package/dist/cli/{index-xhb4gryr.js → index-9xk97bcf.js} +4 -4
- package/dist/cli/{index-kear8gb7.js → index-b3pmzbh1.js} +2 -2
- package/dist/cli/{index-h439y187.js → index-bernkwgf.js} +1 -1
- package/dist/cli/{index-m35hybf0.js → index-bm5xrfnx.js} +1 -1
- package/dist/cli/{index-pyf517sz.js → index-br3mvbsa.js} +2 -2
- package/dist/cli/{index-4r5pmtvk.js → index-bx1wgn3a.js} +4 -4
- package/dist/cli/{index-nwwk3dej.js → index-cgpwjctj.js} +1 -1
- package/dist/cli/{index-wst6n478.js → index-dvbf6fpn.js} +1 -1
- package/dist/cli/{index-a8xbvsse.js → index-fgp96k3r.js} +2 -2
- package/dist/cli/{index-5zqakgp4.js → index-fhh02gwx.js} +3 -3
- package/dist/cli/{index-dfyv3xkd.js → index-gfbggp8k.js} +9 -9
- package/dist/cli/{index-kkmezerc.js → index-j144fgk8.js} +4831 -2776
- package/dist/cli/{index-xkf3672y.js → index-mjn6aqqk.js} +2 -2
- package/dist/cli/{index-3jmb4ppa.js → index-n0d5hrs4.js} +2 -2
- package/dist/cli/{index-v3xc4sde.js → index-nbdmdyke.js} +2 -1
- package/dist/cli/{index-z6qreakh.js → index-nprdr0sm.js} +6 -4
- package/dist/cli/{index-bvqqwx84.js → index-nyn01yrz.js} +2 -2
- package/dist/cli/{index-q8091q8b.js → index-p6fj7qz7.js} +3 -3
- package/dist/cli/{index-gh9ybrrs.js → index-pw00xcj0.js} +7 -7
- package/dist/cli/{index-bw9x8d8n.js → index-r1z8nrb6.js} +5 -5
- package/dist/cli/{index-2xbww1x0.js → index-ssx8087p.js} +7 -7
- package/dist/cli/{index-4kv1ew3q.js → index-t73888m0.js} +1 -1
- package/dist/cli/{index-91ww9hyr.js → index-td6xrw55.js} +1 -1
- package/dist/cli/{index-gp9yzr1v.js → index-xnpjwc4h.js} +1 -1
- package/dist/cli/{index-yt9n9zt3.js → index-xztkjj3c.js} +48 -41
- package/dist/cli/{index-5g6rhkn7.js → index-ye43mdfm.js} +36 -1
- package/dist/cli/{index-w3x1dmrf.js → index-z5vas8c3.js} +40 -39
- package/dist/cli/{index-chebm5h5.js → index-zw3hkzch.js} +3 -3
- package/dist/cli/index.js +45 -39
- package/dist/cli/{knowledge-escalator-135dz4eh.js → knowledge-escalator-pz2faktx.js} +13 -13
- package/dist/cli/{knowledge-events-27gwv47q.js → knowledge-events-s6s8qedx.js} +11 -11
- package/dist/cli/{knowledge-link-dr3xnwyd.js → knowledge-link-rkxfrmhm.js} +4 -4
- package/dist/cli/{knowledge-store-80m44bfw.js → knowledge-store-dgv3xw3h.js} +5 -5
- package/dist/cli/{knowledge-validator-crsfb2cc.js → knowledge-validator-22qppdyv.js} +7 -7
- package/dist/cli/{pending-delegations-gwgjzzkz.js → pending-delegations-4r21nf9d.js} +12 -12
- package/dist/cli/{pr-subscriptions-g633nhz4.js → pr-subscriptions-d52xy3zd.js} +12 -12
- package/dist/cli/{pr-workflow-gate-4dc5nt2e.js → pr-workflow-gate-0de81kzw.js} +40 -39
- package/dist/cli/{runner-k0ycgv8x.js → runner-1dwrgyyr.js} +6 -6
- package/dist/cli/{scan-cursor-avxjsm4w.js → scan-cursor-ahbbejab.js} +6 -6
- package/dist/cli/{schema-3ja77k4y.js → schema-17h2hcw9.js} +5 -1
- package/dist/cli/{scope-persistence-f540tc50.js → scope-persistence-gcn3zm5e.js} +14 -14
- package/dist/cli/{skill-generator-kcqqpg1g.js → skill-generator-hkqr5qs7.js} +15 -15
- package/dist/cli/{snapshot-coordination-init-e4s8bn4p.js → snapshot-coordination-init-ms36zxv6.js} +40 -39
- package/dist/cli/{telemetry-2wzapf11.js → telemetry-fdtaemnv.js} +1 -1
- package/dist/cli/{workspace-snapshot-rkgxhj9b.js → workspace-snapshot-hkz2wt1c.js} +4 -4
- package/dist/cli/{worktree-collision-ownership-rk9gz638.js → worktree-collision-ownership-7v7gg511.js} +18 -104
- package/dist/cli/{worktree-isolation-1bdzfgky.js → worktree-isolation-nanamt25.js} +40 -39
- package/dist/commands/ci.d.ts +40 -0
- package/dist/commands/destructive-purge.d.ts +85 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/registry.d.ts +10 -2
- package/dist/commands/reset-session.d.ts +5 -1
- package/dist/config/constants.d.ts +4 -1
- package/dist/config/lane-context.d.ts +19 -0
- package/dist/config/schema.d.ts +77 -0
- package/dist/evaluation/index.d.ts +1 -0
- package/dist/evaluation/retrieval-quality.d.ts +116 -0
- package/dist/failures/invocation-failure.d.ts +23 -4
- package/dist/hooks/gate-denial-tracker.d.ts +18 -14
- package/dist/hooks/init-orphan-recovery.d.ts +7 -0
- package/dist/hooks/pr-workflow-gate.d.ts +8 -2
- package/dist/index.js +616 -608
- package/dist/memory/embeddings/reranker.d.ts +13 -2
- package/dist/memory/evaluation.d.ts +99 -0
- package/dist/memory/heldout-evaluation-corpus.d.ts +51 -0
- package/dist/memory/index.d.ts +5 -2
- package/dist/memory/sqlite-provider.d.ts +35 -1
- package/dist/memory/types.d.ts +14 -0
- package/dist/observability/otel-mapping.d.ts +5 -5
- package/dist/observability/otlp-exporter.d.ts +80 -0
- package/dist/parallel/lane-owners.d.ts +76 -0
- package/dist/sandbox/macos/sandbox-exec-executor.d.ts +48 -11
- package/dist/tools/repo-graph/query.d.ts +6 -1
- package/dist/tools/repo-graph/types.d.ts +13 -4
- package/dist/utils/bun-compat.d.ts +20 -0
- package/dist/utils/gitignore-warning.d.ts +5 -2
- package/dist/worktree/base-migration.d.ts +55 -0
- package/dist/worktree/core.d.ts +15 -6
- package/dist/worktree/ownership.d.ts +66 -0
- package/opencode-swarm.schema.json +97 -0
- package/package.json +4 -2
- package/tests/fixtures/memory-recall-heldout/manifest.json +311 -0
- package/tests/fixtures/memory-recall-heldout/sources/bash.sh +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/c.c +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/cpp.cpp +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/csharp.cs +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/css.css +3 -0
- package/tests/fixtures/memory-recall-heldout/sources/dart.dart +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/go.go +3 -0
- package/tests/fixtures/memory-recall-heldout/sources/ini.ini +2 -0
- package/tests/fixtures/memory-recall-heldout/sources/java.java +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/javascript.js +3 -0
- package/tests/fixtures/memory-recall-heldout/sources/kotlin.kt +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/php.php +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/powershell.ps1 +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/python.py +2 -0
- package/tests/fixtures/memory-recall-heldout/sources/regex.regex +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/ruby.rb +3 -0
- package/tests/fixtures/memory-recall-heldout/sources/rust.rs +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/swift.swift +1 -0
- package/tests/fixtures/memory-recall-heldout/sources/tsx.tsx +3 -0
- package/tests/fixtures/memory-recall-heldout/sources/typescript.ts +3 -0
- package/dist/cli/curator-llm-factory-ygxd6hfx.js +0 -71
- package/dist/cli/guardrail-explain-vjtjhgzs.js +0 -72
- package/dist/cli/hive-promoter-3czsx7c6.js +0 -86
package/dist/config/schema.d.ts
CHANGED
|
@@ -882,6 +882,62 @@ export declare const ConsensusConfigSchema: z.ZodObject<{
|
|
|
882
882
|
report_retention: z.ZodDefault<z.ZodNumber>;
|
|
883
883
|
}, z.core.$strip>;
|
|
884
884
|
export type ConsensusConfig = z.infer<typeof ConsensusConfigSchema>;
|
|
885
|
+
/**
|
|
886
|
+
* Opt-in remote OTLP/OpenInference observability export (issue #2485).
|
|
887
|
+
*
|
|
888
|
+
* Disabled by default: local operation — plugin init, the SQLite sink, the
|
|
889
|
+
* legacy telemetry stream, /swarm report — is fully independent of the
|
|
890
|
+
* exporter and of any collector/network. When enabled, the exporter
|
|
891
|
+
* registers as a telemetry listener (the same O(1) shape as the SQLite
|
|
892
|
+
* observability sink), persists privacy-filtered records in a bounded
|
|
893
|
+
* spool under `.swarm/otlp-export/`, and ships them as OTLP/HTTP JSON to
|
|
894
|
+
* `endpoint` with bounded retry/backoff and a cooldown circuit. Endpoint
|
|
895
|
+
* policy: `https:` required for remote collectors; plain `http:` is
|
|
896
|
+
* accepted only for loopback test collectors.
|
|
897
|
+
*/
|
|
898
|
+
export declare const OtlpExportConfigSchema: z.ZodObject<{
|
|
899
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
900
|
+
endpoint: z.ZodDefault<z.ZodString>;
|
|
901
|
+
convention: z.ZodDefault<z.ZodEnum<{
|
|
902
|
+
genai: "genai";
|
|
903
|
+
openinference: "openinference";
|
|
904
|
+
}>>;
|
|
905
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
906
|
+
batchSize: z.ZodDefault<z.ZodNumber>;
|
|
907
|
+
flushIntervalMs: z.ZodDefault<z.ZodNumber>;
|
|
908
|
+
requestTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
909
|
+
spoolMaxBytes: z.ZodDefault<z.ZodNumber>;
|
|
910
|
+
spoolMaxAgeMs: z.ZodDefault<z.ZodNumber>;
|
|
911
|
+
maxRetries: z.ZodDefault<z.ZodNumber>;
|
|
912
|
+
backoffBaseMs: z.ZodDefault<z.ZodNumber>;
|
|
913
|
+
backoffMaxMs: z.ZodDefault<z.ZodNumber>;
|
|
914
|
+
circuitThreshold: z.ZodDefault<z.ZodNumber>;
|
|
915
|
+
circuitCooldownMs: z.ZodDefault<z.ZodNumber>;
|
|
916
|
+
}, z.core.$strip>;
|
|
917
|
+
export type OtlpExportConfig = z.infer<typeof OtlpExportConfigSchema>;
|
|
918
|
+
/** Observability block. Only the opt-in remote export today. */
|
|
919
|
+
export declare const ObservabilityConfigSchema: z.ZodObject<{
|
|
920
|
+
export: z.ZodOptional<z.ZodObject<{
|
|
921
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
922
|
+
endpoint: z.ZodDefault<z.ZodString>;
|
|
923
|
+
convention: z.ZodDefault<z.ZodEnum<{
|
|
924
|
+
genai: "genai";
|
|
925
|
+
openinference: "openinference";
|
|
926
|
+
}>>;
|
|
927
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
928
|
+
batchSize: z.ZodDefault<z.ZodNumber>;
|
|
929
|
+
flushIntervalMs: z.ZodDefault<z.ZodNumber>;
|
|
930
|
+
requestTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
931
|
+
spoolMaxBytes: z.ZodDefault<z.ZodNumber>;
|
|
932
|
+
spoolMaxAgeMs: z.ZodDefault<z.ZodNumber>;
|
|
933
|
+
maxRetries: z.ZodDefault<z.ZodNumber>;
|
|
934
|
+
backoffBaseMs: z.ZodDefault<z.ZodNumber>;
|
|
935
|
+
backoffMaxMs: z.ZodDefault<z.ZodNumber>;
|
|
936
|
+
circuitThreshold: z.ZodDefault<z.ZodNumber>;
|
|
937
|
+
circuitCooldownMs: z.ZodDefault<z.ZodNumber>;
|
|
938
|
+
}, z.core.$strip>>;
|
|
939
|
+
}, z.core.$strip>;
|
|
940
|
+
export type ObservabilityConfig = z.infer<typeof ObservabilityConfigSchema>;
|
|
885
941
|
export declare const MemoryConfigSchema: z.ZodObject<{
|
|
886
942
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
887
943
|
provider: z.ZodDefault<z.ZodEnum<{
|
|
@@ -2563,6 +2619,27 @@ export declare const PluginConfigSchema: z.ZodObject<{
|
|
|
2563
2619
|
latencyBudgetMs: z.ZodDefault<z.ZodNumber>;
|
|
2564
2620
|
}, z.core.$strip>>;
|
|
2565
2621
|
}, z.core.$strip>>;
|
|
2622
|
+
observability: z.ZodOptional<z.ZodObject<{
|
|
2623
|
+
export: z.ZodOptional<z.ZodObject<{
|
|
2624
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
2625
|
+
endpoint: z.ZodDefault<z.ZodString>;
|
|
2626
|
+
convention: z.ZodDefault<z.ZodEnum<{
|
|
2627
|
+
genai: "genai";
|
|
2628
|
+
openinference: "openinference";
|
|
2629
|
+
}>>;
|
|
2630
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
2631
|
+
batchSize: z.ZodDefault<z.ZodNumber>;
|
|
2632
|
+
flushIntervalMs: z.ZodDefault<z.ZodNumber>;
|
|
2633
|
+
requestTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
2634
|
+
spoolMaxBytes: z.ZodDefault<z.ZodNumber>;
|
|
2635
|
+
spoolMaxAgeMs: z.ZodDefault<z.ZodNumber>;
|
|
2636
|
+
maxRetries: z.ZodDefault<z.ZodNumber>;
|
|
2637
|
+
backoffBaseMs: z.ZodDefault<z.ZodNumber>;
|
|
2638
|
+
backoffMaxMs: z.ZodDefault<z.ZodNumber>;
|
|
2639
|
+
circuitThreshold: z.ZodDefault<z.ZodNumber>;
|
|
2640
|
+
circuitCooldownMs: z.ZodDefault<z.ZodNumber>;
|
|
2641
|
+
}, z.core.$strip>>;
|
|
2642
|
+
}, z.core.$strip>>;
|
|
2566
2643
|
learning: z.ZodOptional<z.ZodObject<{
|
|
2567
2644
|
realtime_admission: z.ZodPrefault<z.ZodObject<{
|
|
2568
2645
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -12,6 +12,7 @@ export { createEvaluationModelDispatcher, resolveEvaluationAgentName, } from './
|
|
|
12
12
|
export * from './pr-review-recovery.js';
|
|
13
13
|
export * from './public-api.js';
|
|
14
14
|
export * from './retention.js';
|
|
15
|
+
export { type AggregateExactMeasurement, type ExactMeasurement, evaluateHeldoutGraphRetrievalQuality, type HeldoutGraphQualityCase, type HeldoutGraphQualityReport, type RetrievalQualityOptions, type RetrievalQualityResourceCaps, type RetrievalQualityStatus, type RetrievalRouteMeasurement, } from './retrieval-quality.js';
|
|
15
16
|
export type { EvaluationExecutor, EvaluationExecutorResult, RunEvaluationOptions, } from './runner.js';
|
|
16
17
|
export { createModelEvaluationExecutor, runEvaluation, } from './runner.js';
|
|
17
18
|
export * from './statistics.js';
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { buildWorkspaceGraphAsync } from '../tools/repo-graph/builder';
|
|
2
|
+
export declare const _internals: {
|
|
3
|
+
buildWorkspaceGraphAsync: typeof buildWorkspaceGraphAsync;
|
|
4
|
+
};
|
|
5
|
+
export interface RetrievalQualityResourceCaps {
|
|
6
|
+
max_files: number;
|
|
7
|
+
walk_budget_ms: number;
|
|
8
|
+
max_tokens: number;
|
|
9
|
+
top_n: number;
|
|
10
|
+
}
|
|
11
|
+
export interface RetrievalQualityOptions {
|
|
12
|
+
corpusDirectory: string;
|
|
13
|
+
resourceCaps?: Partial<RetrievalQualityResourceCaps>;
|
|
14
|
+
/** Test-only diagnostic escape hatch. Production callers must clean up. */
|
|
15
|
+
keepTempRoot?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type RetrievalQualityStatus = 'complete' | 'degraded' | 'skipped';
|
|
18
|
+
export interface ExactMeasurement {
|
|
19
|
+
expected: string[];
|
|
20
|
+
observed: string[];
|
|
21
|
+
true_positive_count: number;
|
|
22
|
+
false_negative: string[];
|
|
23
|
+
false_positive: string[];
|
|
24
|
+
precision: number;
|
|
25
|
+
recall: number;
|
|
26
|
+
}
|
|
27
|
+
export interface RetrievalRouteMeasurement {
|
|
28
|
+
status: RetrievalQualityStatus;
|
|
29
|
+
provenance: 'direct-source-fallback' | 'fresh-indexed-subgraph' | 'unavailable';
|
|
30
|
+
degradation_reason?: string;
|
|
31
|
+
graph_hit: boolean;
|
|
32
|
+
positive_hit: boolean;
|
|
33
|
+
fallback_reason: string | null;
|
|
34
|
+
actions: string[];
|
|
35
|
+
matched_resource_count: number;
|
|
36
|
+
}
|
|
37
|
+
export interface HeldoutGraphQualityCase {
|
|
38
|
+
id: string;
|
|
39
|
+
language: string;
|
|
40
|
+
analyzer: {
|
|
41
|
+
declared_id: string | null;
|
|
42
|
+
implementation: 'extractFileSymbols';
|
|
43
|
+
};
|
|
44
|
+
source: {
|
|
45
|
+
hash: string;
|
|
46
|
+
provenance: 'direct-source';
|
|
47
|
+
};
|
|
48
|
+
status: RetrievalQualityStatus;
|
|
49
|
+
degradation_reason?: string;
|
|
50
|
+
symbols: ExactMeasurement;
|
|
51
|
+
edges: ExactMeasurement;
|
|
52
|
+
known_misses: {
|
|
53
|
+
declared: string[];
|
|
54
|
+
matching_measured_false_negatives: string[];
|
|
55
|
+
};
|
|
56
|
+
spurious_edges: {
|
|
57
|
+
declared: string[];
|
|
58
|
+
matching_measured_false_positives: string[];
|
|
59
|
+
};
|
|
60
|
+
paraphrase: {
|
|
61
|
+
query: string;
|
|
62
|
+
direct_source: RetrievalRouteMeasurement;
|
|
63
|
+
indexed_control: RetrievalRouteMeasurement;
|
|
64
|
+
};
|
|
65
|
+
latency_ms: number;
|
|
66
|
+
}
|
|
67
|
+
export interface HeldoutGraphQualityReport {
|
|
68
|
+
schema_version: 1;
|
|
69
|
+
corpus: {
|
|
70
|
+
id: string;
|
|
71
|
+
version: string | null;
|
|
72
|
+
hash: string;
|
|
73
|
+
split: 'heldout';
|
|
74
|
+
};
|
|
75
|
+
generated_at: string;
|
|
76
|
+
status: RetrievalQualityStatus;
|
|
77
|
+
degradation_reasons: string[];
|
|
78
|
+
resource_caps: RetrievalQualityResourceCaps;
|
|
79
|
+
resource_usage: {
|
|
80
|
+
case_count: number;
|
|
81
|
+
graph_node_count: number;
|
|
82
|
+
graph_edge_count: number;
|
|
83
|
+
indexed_storage_available: boolean;
|
|
84
|
+
};
|
|
85
|
+
summary: {
|
|
86
|
+
symbols: AggregateExactMeasurement;
|
|
87
|
+
edges: AggregateExactMeasurement;
|
|
88
|
+
complete_case_count: number;
|
|
89
|
+
direct_source_fallback_complete_count: number;
|
|
90
|
+
direct_source_fallback_positive_hit_count: number;
|
|
91
|
+
fresh_indexed_control_complete_count: number;
|
|
92
|
+
};
|
|
93
|
+
thresholds: Record<string, number>;
|
|
94
|
+
uncertainty: {
|
|
95
|
+
method: 'deterministic-heldout-corpus';
|
|
96
|
+
confidence: 0.95;
|
|
97
|
+
sample_count: number;
|
|
98
|
+
};
|
|
99
|
+
cases: HeldoutGraphQualityCase[];
|
|
100
|
+
}
|
|
101
|
+
export interface AggregateExactMeasurement {
|
|
102
|
+
expected_count: number;
|
|
103
|
+
observed_count: number;
|
|
104
|
+
true_positive_count: number;
|
|
105
|
+
false_negative_count: number;
|
|
106
|
+
false_positive_count: number;
|
|
107
|
+
precision: number;
|
|
108
|
+
recall: number;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Measure the repository graph and retrieval router against the immutable
|
|
112
|
+
* multilingual held-out corpus. This intentionally owns a disposable project
|
|
113
|
+
* root: graph persistence remains under that root's `.swarm/`, never beside a
|
|
114
|
+
* source fixture or a caller workspace.
|
|
115
|
+
*/
|
|
116
|
+
export declare function evaluateHeldoutGraphRetrievalQuality(options: RetrievalQualityOptions): Promise<HeldoutGraphQualityReport>;
|
|
@@ -32,10 +32,29 @@ export interface ToolFailureClassificationInput {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Redacts secrets/URLs and strips control chars for terminal/display safety.
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* Order of operations (each step exists to keep a prior fix closed):
|
|
36
|
+
* 1. slice to MAX_SANITIZE_INPUT_CHARS (regex-work bound)
|
|
37
|
+
* 2. neutralize ANSI CSI sequences to a single space (#2369 Gap 2 — an SGR
|
|
38
|
+
* final byte `m` is a word character and defeated `\b`; substituting a
|
|
39
|
+
* separator can only create boundaries, never remove one, so the #2363
|
|
40
|
+
* split/join fixes stay closed)
|
|
41
|
+
* 3. redact URLs (against the CSI-neutralized view)
|
|
42
|
+
* 4. redact credential KV pairs — keyword match is UNANCHORED and tolerant
|
|
43
|
+
* of glued key names and identifier suffixes (#2369 Gap 1), and the
|
|
44
|
+
* value matcher tolerates a fill-tolerant auth scheme word (Basic,
|
|
45
|
+
* Digest, …) between separator and credential so `Authorization: Basic
|
|
46
|
+
* <base64>` redacts the credential, not just the scheme
|
|
47
|
+
* 5. redact SCREAMING_CASE KV pairs (unchanged shape)
|
|
48
|
+
* 6. strip residual control/format/DI runs to spaces
|
|
49
|
+
* 7. sweep residual over-long bare `[<params>m` SGR bodies (the >32-char
|
|
50
|
+
* CSI tail the bounded pre-pass cannot match)
|
|
51
|
+
* 8. trim + 512-byte UTF-8 bound
|
|
52
|
+
*
|
|
53
|
+
* Best-effort defense-in-depth for a log-display string, NOT a security
|
|
54
|
+
* boundary: combining marks (U+0300 class) still defeat keyword matching and
|
|
55
|
+
* are deliberately not fixed (#2369 Gap 3 — sweeping `\p{Mn}` would over-redact
|
|
56
|
+
* every legitimate combining accent in non-Latin diagnostics). Glued-key
|
|
57
|
+
* matching (Gap 1) and the CSI pre-pass (Gap 2) were added by #2485.
|
|
39
58
|
*/
|
|
40
59
|
export declare function sanitizeFailureEvidenceDisplay(value: string): string;
|
|
41
60
|
declare function isNeutralExitOne(command: string): boolean;
|
|
@@ -8,21 +8,18 @@
|
|
|
8
8
|
*
|
|
9
9
|
* This module owns that counter. `noteGateDenial` is called from the single
|
|
10
10
|
* catch site wrapping the fail-closed chain in `src/index.ts`. It:
|
|
11
|
-
* 1. classifies the denial by
|
|
12
|
-
*
|
|
11
|
+
* 1. classifies the denial by its bounded structured cause (falling back to
|
|
12
|
+
* the leading code token of the error message),
|
|
13
|
+
* 2. increments a per-(sessionID, invocationID, stable action, cause) streak,
|
|
13
14
|
* 3. APPENDS (never rewrites) escalating guidance to the error message so the
|
|
14
15
|
* model reads it in the tool-rejection text, and
|
|
15
16
|
* 4. at the hard rung, pushes an advisory + emits telemetry.
|
|
16
17
|
*
|
|
17
|
-
* The
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* streak on `Task` → `coder`. Under the interleaving the loop actually
|
|
23
|
-
* exhibits — deny coder, delegate an explorer to investigate, deny coder again —
|
|
24
|
-
* the STOP rung was unreachable. Sub-scoping both the count and the reset by
|
|
25
|
-
* dispatch target makes a success clear only what plausibly succeeded.
|
|
18
|
+
* The action projection intentionally retains only stable routing fields. It
|
|
19
|
+
* canonicalizes the `Task` role and target aliases, while omitting prompts,
|
|
20
|
+
* command content, and other retry-varying payloads. The same projection is
|
|
21
|
+
* used by note, reset, and the test peek/expiry seams, so a success can clear
|
|
22
|
+
* only what plausibly succeeded.
|
|
26
23
|
*
|
|
27
24
|
* Invariants this module must not break:
|
|
28
25
|
* - The caller ALWAYS rethrows. Decoration is append-only, so the leading
|
|
@@ -82,6 +79,13 @@ export declare function gateDenialDiscriminator(tool: string, args: unknown): st
|
|
|
82
79
|
* a per-occurrence key.
|
|
83
80
|
*/
|
|
84
81
|
export declare function deriveGateDenialCode(message: string): string;
|
|
82
|
+
/**
|
|
83
|
+
* Resolve a denial cause from an own data property only. Accessors and
|
|
84
|
+
* inherited values are intentionally ignored so a hostile/frozen error cannot
|
|
85
|
+
* make tracking invoke arbitrary code. The message parser remains the
|
|
86
|
+
* trajectory logger's message-only boundary.
|
|
87
|
+
*/
|
|
88
|
+
export declare function deriveStructuredGateDenialCode(err: unknown): string | undefined;
|
|
85
89
|
/**
|
|
86
90
|
* True when the thrown value is a user/host abort rather than a policy denial.
|
|
87
91
|
* Aborts must not count toward a denial streak AND must not reset one: a user
|
|
@@ -94,7 +98,7 @@ export declare function gateDenialWarnText(count: number, code: string): string;
|
|
|
94
98
|
* The append-only hard rung, modelled on `nonTransientHardStopMessage`
|
|
95
99
|
* (src/hooks/guardrails/nontransient-circuit.ts:336-354).
|
|
96
100
|
*/
|
|
97
|
-
export declare function gateDenialStopText(count: number, code: string, tool: string): string;
|
|
101
|
+
export declare function gateDenialStopText(count: number, code: string, tool: string, actionPattern?: string): string;
|
|
98
102
|
export interface GateDenialOptions {
|
|
99
103
|
/**
|
|
100
104
|
* `guardrails.enabled`. The thresholds live in the `guardrails` config block
|
|
@@ -169,7 +173,7 @@ export declare const _test_exports: {
|
|
|
169
173
|
readonly MAX_DISCRIMINATOR_LENGTH: 64;
|
|
170
174
|
readonly streakCount: () => number;
|
|
171
175
|
/** Read a streak length without mutating it. */
|
|
172
|
-
readonly peekStreak: (sessionID: string, tool: string, code: string,
|
|
176
|
+
readonly peekStreak: (sessionID: string, tool: string, code: string, target?: unknown) => number;
|
|
173
177
|
/** Force a streak's TTL into the past so eviction can be tested. */
|
|
174
|
-
readonly expireStreak: (sessionID: string, tool: string, code: string,
|
|
178
|
+
readonly expireStreak: (sessionID: string, tool: string, code: string, target?: unknown) => void;
|
|
175
179
|
};
|
|
@@ -72,6 +72,13 @@ export interface InitOrphanRecoveryResult {
|
|
|
72
72
|
reason: string;
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Issue #2527: resolves the worktree bases this project enumerates for
|
|
77
|
+
* reclamation — the project-internal default base plus every configured
|
|
78
|
+
* `worktree_dir` override. The LEGACY parent-level shared base is never
|
|
79
|
+
* enumerated for deletion (it is only read by the migration pass).
|
|
80
|
+
*/
|
|
81
|
+
export declare function resolveWorktreeEnumerationBases(directory: string): string[];
|
|
75
82
|
/**
|
|
76
83
|
* Runs bounded orphan cleanup at plugin init time.
|
|
77
84
|
*
|
|
@@ -914,6 +914,8 @@ export declare function abortPrWorkflow(directory: string, sessionID: string, op
|
|
|
914
914
|
}): Promise<{
|
|
915
915
|
mode: PrWorkflowMode;
|
|
916
916
|
prHeadSha?: string;
|
|
917
|
+
/** Remote branch head observed while cancelling a publication generation. */
|
|
918
|
+
observedRemoteHead?: string | null;
|
|
917
919
|
openLanes: number;
|
|
918
920
|
presumedStaleLanes?: string[];
|
|
919
921
|
presumedStaleDisclosure?: string;
|
|
@@ -1280,9 +1282,13 @@ export declare function recordPrFeedbackPushAttemptResult(directory: string, inp
|
|
|
1280
1282
|
* appends the audit event, and NEVER manufactures push authority. Used only
|
|
1281
1283
|
* by `abortPrWorkflow`'s explicit `cancelPublication` arm. Returns the NEW
|
|
1282
1284
|
* state revision when a state write landed (the abort clear must CAS against
|
|
1283
|
-
* it),
|
|
1285
|
+
* it), and the exact remote-head observation (including null when it could not
|
|
1286
|
+
* be resolved).
|
|
1284
1287
|
*/
|
|
1285
|
-
declare function cancelPrFeedbackPublication(directory: string, sessionID: string, reason: string): Promise<
|
|
1288
|
+
declare function cancelPrFeedbackPublication(directory: string, sessionID: string, reason: string): Promise<{
|
|
1289
|
+
revision: number | null;
|
|
1290
|
+
observedRemoteHead: string | null;
|
|
1291
|
+
}>;
|
|
1286
1292
|
export declare function resolvePrReviewWriterRunId(directory: string, sessionID: string, requestedRunId?: string): Promise<string>;
|
|
1287
1293
|
export declare function markPrReviewTriggerEvaluationComplete(directory: string, sessionID: string, runId: string, artifactPath: string): Promise<PrWorkflowGateState>;
|
|
1288
1294
|
/** Freeze one exact inline trigger ledger across every micro dispatch. */
|