Skip to content

Coherence audit (v1.0 final build)

The work list for phases 3 to 7 of the v1.0 final build. Each item names where the problem is, what is wrong, and the fix; the Status column is updated as the build goes (open, done, deferred: <reason>). Decisions referred to as "P2-x" are in design principles.

Snapshot taken at commit 67d256e (156 source files, 26.5k lines; 232 Markdown pages).

1. Command tree

Current tree (26 leaf commands):

Command Problem Fix Phase Status
adapters list, adapters conformance Noun "adapter"; P2 vocabulary is "connector". connectors list, connectors check. 4 done (phase 4)
authority explain, authority validate, authority import-warrant "authority" is a noun for the profile; validate duplicates the pack/profile validator family. profiles explain, profiles validate, profiles import-warrant would add a noun; instead fold into packs validate (profiles are validated with their packs) and keep explain under one grader command: grade is a verb that runs nothing. Decision: profiles validate, profiles explain, profiles import. 4 done (phase 4)
policy explain, policy schema, policy validate A second noun for the same idea (a domain's rules). Domain policies become profiles of a domain (P2-1): profiles validate|explain take either; policy schema folds into schema. 4 done (phase 4)
bench run, bench report bench report duplicates the top-level report (two report entry points). bench run writes its report itself; report <dir> regenerates any output's report. bench brittleness added (phase 12). 4, 12 done (phase 4)
evidence sign, evidence verify, evidence export Signing is a separate step; P2 says --sign on the producing command. --sign on run, bench, generate, env export; evidence sign stays only as the signer for an existing directory? No: one way: --sign at creation and evidence verify. evidence inspect added. 4, 5 done (phase 4)
gate Top-level verb outside the grammar; duplicates --fail-on on run. --fail-on on run and evidence inspect --fail-on for an existing directory; gate removed. 4 done (phase 4)
init Creates a pack; collides with config init. packs init. 4 done (phase 4)
validate Alias of packs validate. Removed (no aliases). 4 done (phase 4)
schema Prints scenario/profile schemas; policy schema is a second one. schema <name> with names scenario, profile, manifest, policy-<domain>; or under packs. Decision: packs schema <name>. 4 done (phase 4)
judge calibrate Calls a model; advisory judge only. Kept as bench judge ? The judge is not a benchmark. Kept as judge calibrate? Not in the P2 grammar. Decision: removed from the CLI; calibration is a script under scripts/ that needs CREDENCESTACK_LIVE, documented in the contributor docs. The --judge flag on run stays. 4 done (phase 4)
keys generate Fine, but not in the grammar groups. evidence keys (Evidence group). 4 done (phase 4)
mcp serve Fine; belongs to "Build agents and worlds". env serve (serves an environment over MCP). 4 done (phase 4)
otel check, otel print Fine. Kept. — done (phase 4)
report Regenerates report.html of a bundle only. report <dir> for every output kind (one engine, phase 6). 6 done (phase 4)
run --max-samples, --runtime-log, --zip, --agent-cmd, --agent-control-url, --result-file, --transport are connector-specific options mixed with run options. Connector options grouped under a "Connector" help panel; --zip removed (export does it). 4 done (phase 4)
(missing) demo, generate, doctor, config show|init, version, env episode|export, mutators list|show, packs show, evidence inspect, bench brittleness. Added in phases 4, 5, 10, 11, 12. 4–12 done (phases 4-12)

Flag inconsistencies

Concept Current spellings Fix (P2-3) Status
packs --pack/-p (run, otel print, bench config), positional packs (packs list, packs validate, validate) --pack/-p repeatable everywhere done (phase 4)
pack path help three different help texts ("Extra directory of packs.", "…e.g. private ones…", "…e.g. a private held-back set…") one shared option done (phase 4)
output --out/-o with six meanings (bundle dir, results dir, zip file, key dir, JSON report file, charts dir); --trace-out; --summary --out is always the parent directory of <kind>-<id>/ (P2-5); files are named by the layout done (phase 4)
seed --seed default 0 with three help texts one shared --seed (int or fresh), default 0 done (phase 4)
JSON --json with five help texts; missing on run, bench run, evidence verify, report, keys generate, connectors check, otel check --json on every command, one help text, prints the manifest-shaped document done (phase 4)
content capture --otel-capture-content --otel-content done (phase 4)
redaction --redact-private (export), --public (bench report) --redact done (phase 4)
scenario --scenario/-s repeatable on run, single on otel print and mcp serve with different defaults (PAY-001 vs none) --scenario/-s repeatable filter everywhere it filters; single-scenario commands take --scenario required done (phase 4)
model --model (run) vs --model/-m (judge) one --model done (phase 4)
fail-on gate --fail-on only --fail-on on run, bench and inspect; default severity-based (P2-8) done (phase 4)
OTel 11 flags × 4 commands defined in cli_otel.py; mcp serve has a second set with different parameter names one shared set (already shared for 4); add to generate, env, bench brittleness; --otel-metrics done (phase 4)
quiet/verbose/colour none --quiet, --verbose, --no-color global done (phase 4)
spend in bench.yaml only (max_usd), CREDENCESTACK_LIVE env --max-usd, --confirm-spend on bench run|brittleness done (phase 4)

Help text

Help strings mix styles: some end with a period, some start with a verb, some with a noun phrase; several mention "held-back", "premium", "private" (--pack-path, --redact-private, --public, --otel-capture-content). Fix: one-line summary in the imperative, short description, one or two examples (phase 4), and no banned words.

2. Configuration

Item Where read Problem Fix Status
CREDENCESTACK_PACK_PATH packs/loader.py:301 read directly settings packs.path (CREDENCESTACK_PACKS_PATH) done (phase 4)
CREDENCESTACK_MODEL agents/naive_lc.py:38 read directly, inside an agent settings bench.model? The reference agents take model explicitly; env read removed; CLI --model done (phase 4)
CREDENCESTACK_HTTP_TOKEN adapters/http_adapter.py:93 read directly settings connectors.http_token (CREDENCESTACK_CONNECTORS_HTTP_TOKEN), secret done (phase 4)
CREDENCESTACK_OTEL telemetry/config.py:132,178 own resolver settings otel.enabled (CREDENCESTACK_OTEL_ENABLED); OTEL_* stay with the SDK done (phase 4)
CREDENCESTACK_SIGNING_KEY docs and CI only documented, never read by code settings evidence.signing_key (CREDENCESTACK_EVIDENCE_SIGNING_KEY) used by --sign done (phase 4)
CREDENCESTACK_LIVE, CREDENCESTACK_LIVE_* tests only test switch stays a test-only switch, documented in testing.md done (phase 4)
CREDENCESTACK_TASK_FILE, _RUN_ID, _MCP_URL set by the MCP connector for the agent process outputs, not settings kept (they are written for the agent, not read); documented done (phase 4)
OTEL_EXPORTER_OTLP_*, OTEL_SERVICE_NAME cli_otel.py:225, telemetry/tracer.py:283 read outside the OTel module (cli_otel.py) read only in otel/ done (phase 4)
bench.yaml bench/config.py its own config file with pack_paths stays the benchmark definition (an input, like a pack); machine settings move to credencestack.toml done (phase 4)
crewai_adapter.py:55 sets env vars os.environ.setdefault process-wide side effect kept, documented: it turns CrewAI's own telemetry off before import done (phase 4)
project file none no credencestack.toml add (phase 5) done (phase 4)

3. Outputs

Command Writes today Problem Fix Status
run evidence/<uuid hex>/ (manifest.json credencestack.evidence-bundle/v1, results.json, mappings.json, report.html, traces/, authority/, inspect_logs/, otel/ids.json, optional runtime/, reconciliation.json, traces_private/), optional <out>.zip ad-hoc default path; uuid ids credencestack-out/run-<id>/ with the shared manifest done (phases 4 and 5): layout, ids and the shared manifest
bench run bench-results/<time>/ with bench_run.json, results.csv, one bundle per configuration second layout, second manifest-like file bench-<id>/ with the shared manifest; configurations as sub-runs done (phases 4 and 5): layout, ids and the shared manifest
bench report benchmark.md, charts, benchmark_public.md, charts_public/ public/private duplicate outputs one report, --redact done (phases 4 and 5): layout, ids and the shared manifest
evidence export a zip not a directory; no manifest of its own export-<id>/ (+ optional zip) with manifest kind: export done (phases 4 and 5): layout, ids and the shared manifest
evidence sign signature.json in place separate command --sign at creation done (phases 4 and 5): layout, ids and the shared manifest
adapters conformance JSON report to --out file ad-hoc connectors check writes check-<id>/? It is a check, not a run: stays stdout/JSON; committed reports under src/.../conformance/reports/ regenerated by a script done (phases 4 and 5): layout, ids and the shared manifest
authority import-warrant profile YAML to --out file ok (it creates an input) kept as file output done (phases 4 and 5): layout, ids and the shared manifest
keys generate signing.key, signing.pub ok (inputs, not results) kept done (phases 4 and 5): layout, ids and the shared manifest
mcp serve --trace-out JSONL file ad-hoc removed; serve writes run-<id>/? It serves one episode: writes nothing unless --out done (phases 4 and 5): layout, ids and the shared manifest
init pack directory input, ok packs init done (phases 4 and 5): layout, ids and the shared manifest
no latest pointer — — add per kind done (phases 4 and 5): layout, ids and the shared manifest

4. Identifiers

Id Today Fix Status
run uuid4().hex (32 hex) in cli.py:331, pipeline.py:87, cli_otel.py:331, cli_mcp.py:171; uuid4().hex[:12] in mcp_agent.py:170 run-YYYYMMDD-XXXXXX from one helper done (phase 4)
bench timestamp directory bench-YYYYMMDD-XXXXXX done (phase 4)
bundle the run directory same as run id done (phase 4)
scenario public free-form; H-<PACK>-<NNN>; P-<AREA>-<NNN> one form; generated G-<PACK>-<seed>-<index>; confidential shown as confidential:<hash> done (phase 8): G-<PACK>-<seed>-<index>
trace ids OTel ids in otel/ids.json (credencestack.otel-ids/v1) listed in the manifest otel section done (phase 5): the manifest otel section names the trace id and otel/ids.json

5. Reports and terminal output

Output Problem Fix Status
Evidence report (evidence/templates/report.html.j2, evidence/report.py) its own CSS; mentions held-back/premium; "oracle" in labels the shared engine and template set done (phase 6): credencestack.reports
Six-pillar report built into the evidence report (mappings section); no separate kind a section of the shared engine done (phase 6)
Redacted export zip without a report of its own report regenerated with --redact done (phase 5, 6): export-<id>/ directories with their own report
Bench report (bench/report.py, Markdown + PNG, 704 lines) second engine; its own chart style (matplotlib defaults partly) shared engine; shared chart style done (phase 6): credencestack.reports
otel print tree print with its own formatting console module done (phase 4)
Terminal tables rich tables built ad hoc in cli.py, cli_packs.py, cli_adapters.py, cli_bench.py; percent formats differ (100% vs 83.3%), intervals as 21% to 100% console module: header, one table order, 83.3%, [71.2–91.0] done (phase 4)
Errors error: ... printed by fail() in cli_common; tracebacks escape for unexpected errors (seen: otel print before 67d256e) error:/hint:/docs:; exception hierarchy; tracebacks only with --verbose done (phase 4)

6. Vocabulary

Concept Terms in use Decision (P2-1) Status
deterministic rule engine oracle (src 122, docs 450), grader (src 49, docs 97: the graders/ package of Inspect scorers) grader for the rule engines; the Inspect scorers keep Inspect's own word "scorer" done (phases 3-4)
framework integration adapter (src 639, docs 606), connector (docs 426) connector done (phases 3-4)
content visibility public, heldout, held-back, premium, private public, confidential done (phases 3-4)
authority YAML profile, authority profile, mandate (tool name lookup_mandate) profile; lookup_mandate is an environment tool name the agent sees (kept, it is the world's vocabulary) done (phases 3-4)
domain YAML domain policy, policy profile with a domain? The domain policy and the authority profile are different documents. Decision: "profile" = authority profile; "domain policy" stays the second document type, explained in the glossary done (phases 3-4)
graded failure finding (334), violation (6) finding done (phases 3-4)
one scenario × epoch episode, sample (Inspect), epoch episode (an epoch of a scenario); "sample" only when quoting Inspect done (phases 3-4)

7. Telemetry

Item Problem Fix Status
package name credencestack.telemetry credencestack.otel (P2-11) done (phase 4)
registry semconv.py holds names but no privacy class; nothing fails on an unregistered name add privacy class and a coverage test (phase 13) done (phase 13): semconv registry, otel.validate.unregistered
not instrumented generation, environment episodes, brittleness phase 13 done (phase 13)
metrics none --otel-metrics (phase 13) done (phase 13): six low-cardinality instruments
content flag --otel-capture-content --otel-content done (phase 4)
held-back handling public_summary, credencestack.content_redacted for heldout/premium confidential only done (phase 4)

8. Python API

Item Problem Fix Status
credencestack/__init__.py exports only the version deliberate surface (P2-11) done (phase 7): run, select_packs, verify, load_profile, grader_for, the models, Settings and the errors
subpackages 20 top-level subpackages, most with __all__ but no stated public/private line public: credencestack, .connectors, .forge, .env, .otel; rest under _internal done (phase 7): public packages documented in docs/reference/python/; the rest documented as internal (P2-11 keeps runner, packs and evidence in place)
cli modules 11 cli_*.py modules at the top level cli/ package done (phase 4)
names Adapter, AgentAdapter, get_agent_adapter, decide (oracle), KeyError_ connector names; grader names; KeyError_ → KeyFileError done (phase 4)

9. Code structure

Item Where Fix Status
SHA-256 helpers evidence/manifest.py, runner/seeds.py, packs/loader.py, integrations/ap2.py, verifiable/{merkle,signing,chain,verify}.py, telemetry/spans.py one _internal/hashing.py (sha256 hex, canonical JSON) done (phase 4): moved to _internal/canonical.py
canonical JSON verifiable/canonical.py moves to the same module done (phase 4): moved to _internal/canonical.py
YAML loading 10 modules call yaml.safe_load one _internal/io.py (load_yaml, load_json, schema validation) done (phase 7): read_data, parse_data, validation_errors; a test allows yaml.safe_load only there
statistics graders/stats.py (Wilson), bench/report.py (intervals) one _internal/stats.py (Wilson, Newcombe, kappa) done (phase 7)
seeding runner/seeds.py _internal/seeding.py, used by Forge done (phase 7): derive, derive_seed, rng, fresh_seed (byte-identical seeds)
console cli_common.py console, err_console cli/console.py, the only printer done (phases 3-4)
print( cli_mcp.py, domains/policy.py, packs/schema.py, adapters/mcp_bridge.py console module or logger done (phases 3-4)
logging one getLogger in the whole tree credencestack.* logger tree done (phase 7): _internal/log.py; the console shows warnings, debug with --verbose
exceptions 18 unrelated exception classes (BenchError, PackError, BundleError, GateError, ProfileError, PolicyError, TelemetryConfigError, …) CredenceStackError hierarchy mapped to exit codes (P2-9) done (phases 3-4)
visibility core/visibility.py, evidence/privacy.py (traces_private/) two values; confidential redaction done (phases 3-4)
dead code to confirm with coverage phase 7 done (phase 7): two exporters duplicating packs schema, one unused KYC helper, runner/seeds.py removed

10. Documentation

232 Markdown files: 15 at docs/ top level, 18 guides, 12 integrate pages, 15 observability pages, 38 generated reference pages, 61 under docs/dev/.

Item Problem Fix Status
overlaps authority-profiles.md and guides/authority-profiles.md; reading-the-report.md and guides/reading-the-report.md; concepts.md and guides/concepts-in-10-minutes.md; running.md and benchmarks/running.md; frameworks.md, integrate/index.md and guides/index.md one page each in the phase 14 structure done (phase 14): each pair merged into one page; the originals deleted
private-content pages open-source-boundary.md, examples/private-pack-template/, held-back sections in scenarios.md, evidence-bundle.md, benchmarks/methodology.md, faq.md, why/ removed or rewritten (phase 3) done (phase 3)
single-phase pages dev/build-log.md, build-summary.md, build-summary-otel.md, v1.0-docs-review.md, doc-inventory.md docs/dev/history/ done (phase 14); doc-inventory.md stays in docs/dev/ as the living inventory
stale radar.md, maintainer-guide.md (overlaps dev/release-process), integrations/ vs integrate/ (two folders) merged done (phase 14): project/radar.md; the maintainer guide moved under dev/; both folders folded into guides/
reference CLI reference partly generated; no outputs, exit codes, settings or OTel attribute references generated (phases 4, 5, 13, 14) done (phase 14): CLI, configuration, outputs, exit codes, findings, mutators, OpenTelemetry

11. Website

website/ holds only the two design files (design/home.dc.html, design/forge.dc.html); no site exists. The design copy mentions held-back sets, premium content and quarterly rotation (superseded by the spec). Built in phase 15.

Phase 16 additions

Area Finding Decision Status
Confidential scenario ids in bundles P2-6 said redacted exports show confidential:<hash> scenario ids; bundles (and so their redacted exports, which keep the run's signature) show the id and pack with a generic description and no content P2-6 revised to describe the implemented boundary; content never appears (golden-path test), ids are hashed in telemetry and generation outputs deferred: hashing scenario ids inside bundles changes the bundle format and every reader (results, statistics, mappings, seeds, trace paths, the report); a decision for the maintainers before 1.1
Generate manifest Requested --mutators ids were recorded in clear, so a confidential mutator's id reached the manifest Recorded as shown ids (confidential:<hash>) done (phase 16), with a regression test