stadeummwt/dsh-supreme

dsh-supreme

仓库尚未提供可用的公开描述。

未分類agent-safetycordisdeepseek

DSH SUPREME — the governance layer for DeepSeek Harness: seven policy plugins, one bundle install, zero upstream patches, every claim executable

🛡️ DSH SUPREME

The governance layer for DeepSeek Harness

"ECC gives your harness breadth. Supreme gives it a conscience."

Install · dsh plugin --profile <your-profile> add github:stadeummwt/dsh-supreme

At a glance · Why Supreme · Install · The seven plugins · Proof wall · Security · v1.3.1 fixes · Benchmarks · Docs · FAQ


📊 At a glance

Every row below is re-runnable — see the proof wall.

MetricValue
Full suite101/101 Level-A checks · 5/5 real-loader boots · VERDICT COMPLETE
v1.3.1 review probes465/465 across 7 verifiers
v1.3 E2E probes184/184 (policy 85 · workflow 82 · routing 17)
Verdict markers14 green (suite · v131:verify · v13:verify · bundle:verify · composition:verify · v12:verify · v3:verify)
Policy benchmark A/B/C0 escapes after patch · benign 75/75 · Astra NOT_RUN (honest label)
Router latency≈ 0.02–0.04 ms / 1k decisions · RM0-first
Secret sentinel leaks0 every run
Upstream patches0 — pinned d347e703908d, worktree clean
LicenseMIT

🤔 Why Supreme

DSH's plugin ecosystem (3,421 catalog entries reviewed, 2026-09) is rich in single-domain tools — a router here, a memory store there, a verifier somewhere else. Each solves one slice of governance and asks you to trust its output.

Supreme is the opposite design. It is a full governance stack — cost policy, observability, routing, verification, memory policy, workflow limits, security audit — that treats proof as a product feature: every claim in this README maps to a command you can run, and every hard rule (deny paths, cost gates, secret scrubbing) is deterministic code, not model judgment.

The usual DSH pluginDSH Supreme
Solves one domainSeven governance domains, one install
"Trust the output"Verdict gates — COMPLETE only when every check passes
Config verified by vibesConfig-key hygiene scan against real zod schemas (silent-strip trap closed)
Markdown evidencePublished JSON Schemas + append-only JSONL evidence stores
Touches core or monkey-patchesZero upstream patches — pinned upstream, worktree clean, verified every run
Security as a README paragraphSix-surface security audit (prompts · hooks · MCP · permissions · secrets · agent files) in CI
No ML dependencyAlso no ML — deterministic counting, globs and comparisons only. Speed is a feature: router decision ≈ 0.02–0.03 ms / 1k iterations

The core rule of this repo: bukti sebenar > klaim — real evidence over claims. If a statement here can't be re-run by you, it's marked as a claim, not a fact.


⚡ 60-second install

The repository is a dsh bundle — no build step needed (dist/ is committed):

dsh plugin --profile <your-profile> add github:stadeummwt/dsh-supreme

That mounts all seven plugins with safe production defaults:

PAID / TRIAL routes  → DENIED (hard rule, LAB-only override)
UNKNOWN cost class   → DENIED
commands / network   → OFF by default
router candidates    → you add yours in your own patch layer (last write wins)

Zero-thought path: one command does everything

Don't want to think about environments, builds, or profiles at all? The built-in operator CLI (zero dependencies) diagnoses, installs, composes and boot-proves your setup:

node real/supreme.mjs doctor    # what's missing? (prints a fix line per check)
node real/supreme.mjs setup     # EVERYTHING: builds what's missing, runs the real
                                # `dsh plugin add`, applies the composition,
                                # boot-probes it → "SUPREME READY"
node real/supreme.mjs verify    # full verification ladder, PASS/FAIL per gate
node real/supreme.mjs setup --composition standard   # core|standard|supreme|lab

setup is idempotent and never modifies the upstream checkout. It will clone + pin + build the pinned DSH upstream only if it is missing (skip with --no-upstream-build).

v1.3.2 note (Windows): if an earlier version showed bundle:verify … obs stats 0 or a composition:verify dataDir failure — root cause found and fixed (store engines created their parent directory with a POSIX-only separator check; on Windows every record write was silently dropped). Re-run setup (rebuilds dist/), then re-run the verifiers — they now also print full writer stats + an exact diagnosis instead of a bare zero.

Pick a composition in one more line if you don't need all seven:

FragmentActive pluginsUse it for
corepolicygovernance floor on any profile
standardpolicy · observability · memory · verifierdaily-driver
supremeall sevenfull stack
laball seven + LAB overridesexperiments only — never production
dsh --profile <your-profile> \
  --patch "$DSH_HOME/profiles/<your-profile>/node_modules/dsh-supreme/config/compositions/standard.patch.yml"

🧩 The seven governance plugins

Exactly seven. The scope is frozen (AGENTS.md) — no scope creep without a proven blocker.

#PluginServiceWhat it enforces
1supreme-policysupremePolicyCost-class / risk / delegation admission. UNKNOWN cost ⇒ DENY. Paid & trial overrides are LAB-only. Unicode-taint + encoding-blob detection & denial. CoT presence gate with visibility profiles + risk gating. Deny-circumvention (deny_retry) guard. Capability-class gate.
2supreme-observabilitysupremeObservabilityAppend-only JSONL metadata log over official DSH event seams. Allowlisted fields, secret-sentinel scrub, fail-open.
3supreme-benchmarksupremeBenchmarkReproducible task/run/score JSONL evidence; per-model aggregation that feeds the router; commitHash + irVersion provenance binding; evidenceBacked anti-sandbagging flag.
4supreme-routersupremeRouterDeterministic selection: 8 hard gates → weighted scoring → RM0-first cost-class rule → unscoredEvidenceWeight anti-sandbagging downweight → optional verifier-failure-driven effort pacing. Carries CapabilitySignal labels onto decisions.
5supreme-verifiersupremeVerifierDeterministic validator registry (exact-text · regex · JSON · file · command). Evidence > model self-confidence.
6supreme-memory-policysupremeMemoryPolicyMemory selection policy: confidence floor, injection cap, relevance ranking, bounded append-only note ledger (credential-bearing notes rejected at admission).
7supreme-workflow-policysupremeWorkflowPolicyWhen/how ctx.subagents / ctx.workflowEngine may run: limits, degradation ladder, glob path scoping (blocked beats allowed), verifier-gated close for HIGH-risk tasks, A2A contact graph + overreach audit.
flowchart TB
    subgraph SUP["Supreme plugin layer — project-owned, frozen 7"]
        P["supreme-policy"]
        O["supreme-observability"]
        BM["supreme-benchmark"]
        R["supreme-router"]
        V["supreme-verifier"]
        M["supreme-memory-policy"]
        W["supreme-workflow-policy"]
    end
    subgraph CORE["DSH core — pinned upstream · never modified"]
        C["ctx.llm · ctx.sessions · ctx.systemPrompt · ctx.tokenMeter · ctx.credentials · ctx.subagents · ctx.workflowEngine"]
    end
    P --> C
    O --> C
    BM --> C
    R --> C
    V --> C
    M --> C
    W --> C
    P -. consults .-> V
    P -. consults .-> R
    P -. consults .-> W
    O -. optional .-> V
    O -. optional .-> W
    BM -. history .-> R
    V -. evidence .-> W

Four support plugins (supreme-minimal-probe, supreme-boot-probe, supreme-gate-driver, supreme-fake-llm) exist only as test fixtures for the suite — they never ship in the bundle.


🏁 Proof wall — every verdict runnable

Don't trust this README. Run these:

CommandVerdict markerWhat it proves
bun run suiteCOMPLETE101/101 Level-A checks + 5/5 real-loader boots + v1.2/v1.3/v1.3.1 audit gates
bun run v131:verifyV131_COST_FIX_VERIFIED · V131_VERIFIER_FIX_VERIFIED · V131_MEMORY_FIX_VERIFIED · V131_A2A_FIX_VERIFIED · V131_EVIDENCE_BINDING_VERIFIED · V131_OUTCOME_ROUTING_VERIFIED · V131_FAILURE_INJECTION_VERIFIEDReview-hardening end-to-end: cost pre-dispatch deny, symlink-proof roots, JSON-schema strictness, memory isolation, A2A registry, evidence staleness, outcome routing, failure injection (465 probes — see docs/REVIEW-FIXES-v1.3.1.md)
bun run v13:verifyV13_POLICY_E2E_COMPLETE · V13_WORKFLOW_E2E_COMPLETE · V13_ROUTING_E2E_COMPLETEAll 7 v1.3 ASTRA features end-to-end: real engines + real pinned-cordis adapters (85 + 82 + 17 probes)
bun run bundle:verifyBUNDLE_E2E_COMPLETEReal dsh plugin add → reconciler → boot → 13 services → user-patch override wins → clean dispose
bun run composition:verifyCOMPOSITIONS_E2E_COMPLETEAll 4 fragments: service presence and absence, relative dataDir write-through
bun run v12:verifyV12_E2E_COMPLETEEvery v1.2 config key arrives at its service + functional probes (taint deny, effort escalation/recover, path scope, close gate, ledger)
bun run v3:verifyV3_CONFIG_REVIEW_EVIDENCEThe silent-strip trap, live: a wrong config loses 5/6 keys → corrected config enforces 6/6
Level A unit checks      101/101 PASS  (policy 17 · observability 7 · benchmark 11 · router 23
                                       verifier 11 · memory 13 · workflow 19)
v1.3.1 review probes     465/465      (cost 37 · verifier 43 · memory 88 · a2a 63 ·
                                       evidence 82 · outcome-routing 80 · failure-injection 72)
v1.3 E2E probes          184/184      (policy 85 · workflow 82 · routing 17 — real engines,
                                       real pinned-cordis adapters, no upstream build needed)
Real-loader boots        5/5 PASS     (supreme-minimal, core, standard, supreme, lab)
  boot times             supreme-minimal ~51–60 ms · core/standard/supreme/lab ~830–990 ms
Keyless scenario         9/9 gates PASS (real DSH session; router picks free route; PAID rejected)
Security                 sentinel leaks = 0 · paid automatic fallback = DISABLED
v1.2/v1.3 audit gates    config-key hygiene PASS · pinned-ref scan PASS ·
                         six-surface audit PASS (incl. the pinned `workflow/agent-start` seam) ·
                         schema contract PASS (3 schemas)
Upstream integrity       commit unchanged · worktree clean · patches = 0
Performance              router ≈ 0.02–0.04 ms / 1k · observability serialize ≈ 0.001–0.007 ms / 1k
VERDICT                  COMPLETE

Honesty rule: the real-loader path (real/boot.mjs) is the only real-integration evidence. The Level-A harness under src/harness/cordis-mini is a lifecycle fixture — it is never cited as DSH proof.


🔐 Security guarantees

GuaranteeMechanismProof
Secrets never leak through observabilitySecret-sentinel scrub on allowlisted fields, fail-open write pathsuite: sentinelLeaks = 0 every run
Tainted tool arguments can't dispatchUnicode class scan (zero-width / bidi / BOM / tag) + taintPolicy: DENY via upstream tools/pre-executeV12_E2E_COMPLETE functional probe
Denying a command actually stops itDeny-circumvention guard: same-shape retry of a denied call refused (deny_retry) — signature carries names/types, never valuesV13_POLICY_E2E_COMPLETE probes
Hidden payloads can't ride in tool argsEncoding-blob scan (≥256-char base64/hex runs), class names + lengths onlyV13_POLICY_E2E_COMPLETE probes
Self-declared capability labels can't buy permissioncapabilityClassGate ENFORCE/AUDIT; LAB allowlist is floor-bound; labeling only RESTRICTSV13_POLICY_E2E_COMPLETE probes
Inter-agent channels stay on the declared graphallowedContacts directed edges; out-of-graph audited (a2a_contact), DENY blocks pre-factV13_WORKFLOW_E2E_COMPLETE probes
Delegations can't quietly exceed their taskOverreach audit: risk ceiling + approval gate + path scope, value-freeV13_WORKFLOW_E2E_COMPLETE probes
Benchmark scores can't sandbag the routerevidenceBacked flag (verifier-PASS rule) + fixed unscoredEvidenceWeight downweightV13_ROUTING_E2E_COMPLETE probes
Values never echoed in audit eventsTaint/contact/overreach events carry class names, ids and levels onlycode + suite checks
Paid models never fire by accidentUNKNOWN cost ⇒ DENY; allowPaid refused outside LAB; no automatic fallbackkeyless scenario gate 9/9
Destructive delegation is scopedblockedPaths > allowedPaths glob enforcement; DENY_ALL secret policysuite checks 15 (workflow)
HIGH-risk work can't skip verificationrequireVerifierPassOnClose evidence gateV12_E2E_COMPLETE probe
Supply chain stays pinnedExternal refs scanned; upstream commit + irVersion bound into run recordspinned-ref scan PASS
Your own audit, offlineSix-surface audit: prompts · hooks · MCP · permissions · secrets · agent filessuite check PASS

🛡️ v1.3.1 review-hardening

Response to an external v1.3.0 review: 5 findings reproduced → fixed → proven (each with a failing test on the original code), plus outcome-based routing, evidence-bound verification, fast path/recovery, and a failure-injection harness. Full per-issue evidence — reproduction commands, root causes, before/ after outputs, remaining limits, and rollback steps (bash + PowerShell) — lives in docs/REVIEW-FIXES-v1.3.1.md.

#SeverityFinding (v1.3.0)Fix (v1.3.1)
AP1Paid/unknown-model LLM requests dispatched with no cost checkPre-dispatch deny at agent/request + llm/stream backstop; zero adapter calls on deny; UNKNOWN denied in production RM0; LAB exception contract kept
BP1Symlink inside allowedRoots escaped the file-hash verifierNative realpath validation of roots AND targets before any read; traversal/sibling-prefix/missing-file rejected; race reduced (not race-proof — documented)
CP1latestSelection shared across sessions/tasks (memory contamination)Selections bound to (session, task); unknown identity → empty; bounded LRU + cleanup on end/cancel/dispose
DP2copy_file {target: b.txt} misclassified as agent-to-agent contactTrusted comms-tool registry gates recipient extraction; post-fact emit stays detect-only
EP2JSON Schema additionalProperties:false silently ignored (false PASS)Deterministic validator: unsupported keywords → ERROR/UNAVAILABLE, never silent downgrade

Run it: bun run v131:verify (7 markers, 465 probes) — then read the doc before trusting this table.

📈 Benchmarks v1.3.1

Policy-enforcement delta across three labels — same runner, same datasets, thresholds frozen before evaluation, dev + held-out inputs disjoint:

LabelSetupResult
Aharness without Supreme30 cost-policy bypasses
BSupreme v1.3.0 (pre-review-fix)90 escapes (cost 30 · memory 15 · symlink 15 · A2A false-deny 15 · schema false-pass 15)
CSupreme v1.3.10 escapes — all kinds · benign pass 75/75 · overhead ≈ 10 ms/set (median 93 vs 82 ms)

All 6 thresholds PASS. Safety regressions (benign denials) block promotion.

🧬 v1.3 ASTRA-hardening features

Seven deterministic hardening features from the ASTRA-1 backlog (research/gpt6-astra-2026-09.md §7). No ML, no new deps — every feature is engine-checked in the keyless suite and proven end-to-end by bun run v13:verify (real engines + real pinned-cordis adapters). The shared label contract CapabilitySignal { capabilityClass?, cotVisibility? } is exported by supreme-policy and carried (never enforced) by the router.

supreme-policy — four features (config table)
Config keyDefaultMeaning
cotVisibilityProfiles{}routeId → expected CoT visibility. A route declared none never denies on cot_missing — ENFORCE downgrades to audit-only (empty-CoT models can't be coerced into producing a trace). Resolution: explicit signal > profile > verbose.
riskGatedCoTfalseENFORCE applies only to HIGH-risk tools (deterministic command/network/write name classifier); non-HIGH tools keep AUDIT.
denyCircumventionGuardtrueA same-shape retry of an already-denied call is refused with reason code deny_retry. The signature encodes argument NAMES + TYPES only — values can never enter it. First calls unaffected; resetDenyCircumvention(sessionId) is the escape hatch.
enableEncodingScanfalseAudit/deny ≥256-char base64/hex runs in tool arguments (encoding_blob; argument NAME + run LENGTH only). Extends the v1.2 taint surface: same event, same taintPolicy.
capabilityClassGate'OFF'Gate requests carrying capabilityClass: AUDIT records, ENFORCE denies unsanctioned classes. Unlabeled requests always pass untouched.
sanctionedCapabilityClasses / labCapabilityClassAllowlist[] / []Sanction lists; the LAB allowlist is additive and binds ONLY on the LAB floor. No implicit ROUTINE exemption — a self-declared label can only RESTRICT, never grant.
supreme-workflow-policy — two features (config table)
Config keyDefaultMeaning
agentContactPolicy / allowedContacts'LOG_ONLY' / []A2A contact graph: directed { from, to } edges of agent ids/roles (empty = inert). Out-of-graph spawn/message contacts are audited as a2a_contact; under 'DENY' the pre-fact tools/pre-execute waterfall refuses with a2a_contact_denied. Emit-mode seams are DETECT-only.
maxRiskLevel / approvalRequiredFor'HIGH' / []Overreach audit: delegations above the risk ceiling, listed task classes without an approval flag, or paths outside the v1.2 scope are audited as overreach_suspected (labels, levels, flags, config globs — never content).
supreme-router + supreme-benchmark — anti-sandbagging (config table)
Config keyPluginDefaultMeaning
requireEvidenceForScoresbenchmarkfalseScore claims without verifier-PASS evidence are flagged evidenceBacked: false on the score + run (flag only — scores never rewritten; re-evaluated when verification lands late).
unscoredEvidenceWeightrouter1FIXED multiplicative downweight for unevidenced benchmark claims (e.g. 0.5 halves such scores); ids + factors recorded on the decision + unscored_evidence events (ids only). 1 = off, back-compat.
—router—Carries capabilityClass / cotVisibility labels from candidates onto the selected RouteDecision (carrier, not enforcer).
Composition fragments (v1.3 posture)
Fragmentv1.3 keys
coredenyCircumventionGuard: true pinned (the one default-ON); everything else inherits OFF defaults
standardenableEncodingScan: true + capabilityClassGate: AUDIT — audit-only, cannot block
supremesame audit-only policy posture + requireEvidenceForScores: true + workflow keys pinned at behavior-preserving defaults
labenforcing demo: capabilityClassGate: ENFORCE + labCapabilityClassAllowlist, cotVisibilityProfiles + riskGatedCoT, declared contact graph + maxRiskLevel: MEDIUM, unscoredEvidenceWeight: 0.5

🧬 v1.2 governance features

Deterministic. No ML. No new runtime deps. Every feature binds to a real pinned upstream seam and ships with engine checks + boot-level proof (bun run v12:verify).

supreme-policy — unicode taint denial + CoT presence gate

Upstream freezes tool arguments after logging (wrappers may change only exec.signal), so the enforceable host-side posture is detect → audit → deny through the official tools/pre-execute seam ({ kind: 'deny', reason } — upstream materializes the error result; Supreme never fabricates tool output):

Config keyDefaultMeaning
enableUnicodeSanitizationtruescan tool arguments for zero-width / bidi-isolate / bidi-override / tag codepoints (U+200B–200F, U+2060–206F, U+202A–202E, U+FEFF, U+E0000–E007F)
logTaintAttemptstruerecord taint_detected events — class names only, values are NEVER echoed
taintPolicyLOG_ONLYDENY refuses the call before dispatch
reasoningTracePolicyOFFAUDIT records cot_missing when an assistant message carried no reasoning trace; ENFORCE additionally denies that session's tool calls (ENFORCE refused on the CORE floor)