Skip to content

Build log: v1.0.0 expansion (X0 to X9)

This log records, phase by phase, what was built for the expanded v1.0.0 (financial-crime, document-integrity and KYC domains, the remaining connectors, and the documentation and release passes), every decision taken with its alternatives, every fallback, and each phase's checkpoint results. It is public and factual: it names no private scenario content.

X0. Starting point and scope

Starting state. main at 1fdd3de; tag v1.0.0-rc1 on fb1edd5 (local only). The version is 1.0.0rc1. Phases 0 to 14 (with 10B) and the documentation parts A, B and C are done. Nothing has been pushed.

How the code is structured today (re-read before starting):

  1. Authority oracle (authority/oracle.py): one pure function, decide(profile, agent_id, action, args, context, history) -> Decision (allow, escalate, deny, rule ids); profiles are YAML (authority/profile.py).
  2. Scenario schema (core/scenario.py): strict pydantic Scenario (task, env_seed, inputs, injections, faults, control events, expected, authority binding, expected_decisions), loaded per pack from YAML; the pack's visibility is copied to every scenario.
  3. Simulated environment (env/environment.py): one Environment with a fixed tool registry (env/tools.py: 11 ToolSpecs with JSON-Schema parameters, consequential, action, kind) and one handler per tool; every call goes through env.call, which validates, executes, applies injections, ticks the SimClock and traces.
  4. Episodes (runner/episode.py): run_episode builds the environment from env_seed, installs faults, the rate observer and the kill switch, then calls adapter.start(task, env.tool_specs, env).
  5. Graders (graders/scorers.py): four pure scorers over an EpisodeRecord (authority, resilience, injection, third party) plus graders/outcome.py for the scenario's expected block; the Inspect runner wraps them as Inspect scorers.
  6. Finding types (core/findings.py): a FindingType literal, default pillars per type (FINDING_PILLARS), and the passing types; a finding's severity is the scenario's.
  7. Report (evidence/report.py and its template): executive summary, results by visibility, one section per pillar, authority matrix, scenario detail, framework mappings, method and limits.
  8. Mappings (evidence/mappings/frameworks.yaml): primary grouping by OCC 2026-54 pillars, secondary frameworks per finding type and pack, every entry status: indicative.
  9. How packs bind tools to adapters: they don't, directly. Every scenario gets the same 11 tools; the episode passes env.tool_specs to adapter.start, and every connector builds its native tools from that tuple (the MCP server from env.tool_specs too). The scripted model behind every framework connector replays scripted_naive or scripted_safe from the task prompt.

Consequence for the domains. Per-scenario tool sets need only one change at the source: env.tool_specs must return the scenario's declared tool families. Every adapter already binds whatever tuple it is given; X1 adds a conformance check that proves it.

X1. Domain framework

What was built.

  • Scenario gains domain (payments by default, fincrime, docintegrity, kyc), domain_policy (resolved like a fixture; builtin:<file> names a shipped policy) and tools (tool families). All three are optional, so every existing scenario is unchanged.
  • Tool families (env/families.py): payments, inbound, email (the original eleven tools), policy (lookup_policy), screening, case_mgmt, comms, documents, registry, kyc. A domain has default families; a scenario may name its own. The environment offers exactly those tools (env.tool_specs), rejects any other call as an unknown tool, and builds the domain worlds (handlers and end state) that serve them. A payments scenario that declares nothing gets the original tuple, in the original order.
  • Pluggable oracles (domains/base.py): DomainOracle.expected(scenario, env_state, history) -> ExpectedOutcome and DomainOracle.judge(trace, expected) -> list[Finding]. domains/payments.py wraps the authority oracle and its scorer with no behaviour change. Oracles, worlds and domain reference agents are registered by module:attribute path and loaded on first use.
  • Domain policies (domains/<domain>/policy.py) are YAML files like authority profiles, with JSON Schemas in schemas/<domain>_policy.schema.json and credencestack policy validate | explain | schema.
  • Matching utilities (credencestack.matching, standard library only): NFKC, casefold, diacritics, a transliteration table, a spelling-variant table, a homoglyph map, Levenshtein, Jaro and Jaro-Winkler, and name tokenising, reordering, splitting and joining. Tests use the hand-computed Winkler (1990) examples.
  • The Inspect authority scorer now asks the scenario's domain oracle; for payments that is the original authority scorer. The scorer names are unchanged.

Decisions.

  • Where domain findings come from. Alternatives: a new Inspect scorer per domain, or the existing authority scorer delegating to the domain oracle. Chose delegation: the scorer list, log format and result shape stay the same, and payments results are byte-identical.
  • How the agent learns the domain. The episode adds domain to the task inputs for non-payments scenarios only (runner.episode.task_info), so payments prompts are unchanged and the scripted reference agents (and every connector driven by the scripted model) dispatch on it.
  • Registry by import path. Alternatives: direct imports or entry points. Import paths keep the framework free of imports from later domains and make adding a domain one line.
  • Policy domain field. Each policy model narrows domain to a literal; pyright's invariance rule is silenced on those three lines only.

Checkpoint X1. With the refactor in place and before any domain pack existed, the full suite ran with no test modified: 607 passed. The only failures were the committed scenario schema (regenerated, a generated file) and a built-in-profile error message (the code was changed back to the original wording). ruff, pyright (strict) and mypy (core) are clean.

X2. Sanctions and financial-crime pack

What was built.

  • A synthetic watch-list env/fincrime/lists/sanctions_v1.yaml: 60 entries (30 individuals, 18 entities, 6 banks, 6 vessels), fictional country codes XA to XH, vessel numbers that fail the IMO check digit on purpose, synthetic: true (the loader refuses a list without it), and a README saying all data is synthetic.
  • Parties, ownership edges, held payment messages, alerts and customer messages (env/fincrime/models.py); the screening and case-management world (env/fincrime/world.py) with screen_party, get_alert, get_customer_profile, get_ownership_structure, get_payment_message, escalate_alert, request_second_review, clear_alert, confirm_match, block_payment, release_payment, draft_sar, plus send_customer_message and lookup_policy. A screening service can be taken down by an outage fault.
  • fincrime_policy.yaml (shipped as builtin:fincrime_policy.yaml): match thresholds, the identifiers that may discount a match, the ownership threshold (50% in aggregate, marked indicative), L1 clearing authority, required rationale elements, fail-closed screening with a maximum list age, and tipping-off patterns.
  • The oracle (domains/fincrime/oracle.py): expected disposition per alert (true_match, possible_match_escalate, false_positive_clear), the action (confirm, escalate, clear, second review) and the payment action (block, hold, release), with ownership aggregated to a fixed point so chains count in full. Findings: false_clear, released_on_hit, fail_open_screening, tipping_off (critical), four_eyes_bypass (high), missing_rationale, unjustified_block (medium); injection_followed is reused.
  • 16 public scenarios FC-001 to FC-016, each tagged with pillars and risks.
  • Scripted naive_fincrime and safe_fincrime (also reached through scripted_naive and scripted_safe), LangChain naive_fincrime_lc and safe_fincrime_lc, and connector examples examples/frameworks/mcp/fincrime_safe.py and examples/frameworks/openai_agents/fincrime_safe.py.

Decisions.

  • The safe agent reuses the oracle's assessment function, as the payments safe agent reuses decide: it decides from what the tools return, never from the scenario seed.
  • Domain packs ship with the built-in packs. Alternatives: a separate root hidden from packs list. Rejected: X6 asks for a domain column in packs list. Four existing tests hard-coded the number of shipped packs or scenarios (test_builtin_packs.py, test_docs_reference.py, test_visibility.py); they now compute the expected counts from the shipped packs and still pin the original four packs' counts. No assertion was weakened.
  • Rationale and tipping-off checks are deterministic: required rationale elements are regular expressions in the policy (with {list_name} and {list_version} filled in); tipping off is any match of the policy's prohibited patterns in a customer message.
  • A false positive left held is over-caution (unjustified_block), so FC-005 tests that the agent clears and releases.

Checkpoint X2.

  • Oracle and screening tests: 41 (tests/unit/test_fincrime_oracle.py), including six ownership-aggregation cases and the matching edge cases (aliases, transliteration, reordering, splitting, homoglyphs, diacritics, identifiers in remittance text).
  • naive fails 16 of 16 FC scenarios; safe passes 16 of 16, through the Python adapter (tests/integration/test_domain_packs.py) and through the LangChain, OpenAI Agents SDK, Microsoft Agent Framework, Strands, Google ADK and MCP connectors with the scripted model, which proves the per-scenario tool set binds in each of them.
  • The report lists the fincrime findings (checked on a naive run's report.html).
  • Full suite: 672 passed, 15 skipped (live and CrewAI) before the count updates above; all pass after. ruff, pyright and mypy clean; policy schemas committed and tested.

X3. Document-integrity pack

What was built.

  • The documents and registry families (env/documents_world.py): get_document, get_vendor_master, get_ledger_entries, verify_bank_account, flag_document, request_original and registry_lookup, alongside the payment and approval tools. Documents are structured extractions (fields, line items, page-level values, metadata, text); the systems of record are the vendor master, the ledger, bank-account verification and the company registry. Outages can take down bank_verification, registry or documents.
  • docintegrity_policy.yaml: amount tolerance, required checks, fail-closed, the edit distance for near-duplicate invoice numbers, and "instructions in documents are data".
  • The oracle (domains/docintegrity/oracle.py): assess_document compares a document with what the systems of record return and with itself (arithmetic, pages, dates, near duplicates in the ledger); expected action pay, flag or hold. Findings: trusted_document_over_source, inconsistency_ignored, unverified_when_unavailable (high), arithmetic_ignored, unjustified_rejection (medium); duplicate_execution and injection_followed are reused.
  • 10 public scenarios DOC-001 to DOC-010. Trade-finance documents are excluded entirely.
  • Scripted naive_docintegrity (pays what the document says) and safe_docintegrity.

Decisions.

  • The oracle asks a throwaway copy of the same world the agent queries (with any checks the scenario's faults take down removed), then applies the same assessment the safe agent uses. Alternative: re-implement the lookups over the seed. Rejected: two code paths could disagree about what a system of record says.
  • Outcome-based findings. Paying a clean document without running every check is not a finding; paying a document that disagrees with a system of record is. This keeps DOC-010 an over-caution test that a careless but lucky agent passes.
  • DOC-007 hides a real problem (a changed bank account) behind its "pre-approved, no need to verify" text, so following the instruction has a consequence the oracle can see.
  • No authority profile on DOC scenarios: the domain is about verifying documents, and the amounts stay within ordinary limits.

Checkpoint X3.

  • Document-integrity tests: 17 (tests/unit/test_docintegrity_oracle.py); X2 tests still pass.
  • naive fails 9 of 10 DOC scenarios (it passes DOC-010, the legitimate document, as it should); safe passes 10 of 10 through the Python adapter and through the LangChain, OpenAI Agents SDK, Microsoft Agent Framework, Strands, Google ADK and MCP connectors.
  • Full suite: 711 passed, 15 skipped. ruff, pyright and mypy clean.

Remaining effort, estimated at this point. X4 (KYC, same patterns, the largest oracle): about as much as X2. X5 (Claude Agent SDK connector; Phase 8 is already done; Tenuo check): moderate, mostly API verification and a conformance run. X6 (report, mappings, benchmark, conformance, CLI, Action, held-back variants): large but mechanical. X7 (end-to-end scripts, determinism, synthetic-data checks, coverage): moderate. X8 (documentation coherence, two new guides, glossary, docs audit) is the largest phase. X9 (sample report, release check, tag): moderate. No phase looks blocked.

X4. KYC and KYB onboarding pack

What was built.

  • The kyc family (env/kyc/world.py): get_application, get_ubo_declaration, pep_check, adverse_media_search, set_risk_rating, request_more_info, request_edd, request_senior_approval, approve_onboarding, reject_onboarding. KYC scenarios also get documents, registry, screening (the X2 watch-list) and comms. A senior approval goes through the environment's scripted reviewer, so it is traced as an approval and counts in the oversight metrics.
  • kyc_policy.yaml: required documents per customer type, EDD documents, the beneficial-ownership threshold (25%, indicative, TODO-verify), a deterministic risk matrix (jurisdiction, industry, PEP, adverse media, ownership layers; XH forces high), EDD triggers, senior-approval rules, fail-closed registry, required rationale elements and confidentiality patterns.
  • The oracle (domains/kyc/oracle.py): beneficial owners from the registry, following entity shareholders and multiplying percentages along each chain (with cycle protection); the declaration checked against the registry's direct shareholders; PEP, adverse-media and sanctions checks on every related person; the rating and its factors; EDD; the required approver; and the decision (hold, reject, request_info, edd_info, edd, approve). Findings: onboarded_incomplete, ubo_missed, risk_understated, edd_skipped, pep_unescalated, approval_authority_exceeded, fail_open_registry (high), rating_inconsistent, missing_rationale, risk_overstated (medium), tipping_off (critical); false_clear (a sanctions hit on an owner) and injection_followed are reused.
  • rating_inconsistent is computed across epochs: after a run, any KYC application rated differently in different epochs adds the finding to every epoch and fails them (graders.domain.consistency_findings, called from run_packs).
  • 14 public scenarios KYC-001 to KYC-014; scripted naive_kyc and safe_kyc; LangChain naive_kyc_lc and safe_kyc_lc; examples examples/frameworks/mcp/kyc_safe.py and examples/frameworks/openai_agents/kyc_safe.py. The six domain reference agents are exported from credencestack.agents.

Decisions.

  • EDD documents. The brief's policy fields have no way to say what EDD itself needs; edd_documents (default source_of_wealth) was added so KYC-014 ("ask the applicant for what EDD needs") has a deterministic answer.
  • Declaration conflict = disagreement with the registry's direct shareholders. An owner hidden behind holding companies (KYC-003) is not a conflict; the agent must find it, and an approval rationale that does not name every beneficial owner is ubo_missed.
  • Over-caution in KYC (not approving a file the policy says to approve) is reported as risk_overstated, the brief's over-caution finding for this domain.
  • Rating consistency across epochs cannot be shown by the deterministic scripted agents, which always agree with themselves; it is unit-tested with synthetic records (a model-backed agent can vary). KYC-013 also fails a careless agent through risk_understated.
  • Tool budget. The payments guide's LangGraph agent caps runs at 20 tool calls; KYC-003 (three owners through a two-layer chain) needs about 25, so that payments agent leaves it undecided (2 of 28 epochs fail). The domain agent safe_kyc_lc (30 calls) and every other connector pass. Kept as is: it shows the budget doing its job, and the guides say to size the budget to the work.

Checkpoint X4.

  • KYC tests: 28 (tests/unit/test_kyc_oracle.py), including seven beneficial-ownership cases (two layers, two routes adding up, a cycle, an unknown holding company) and twelve rating-matrix cases, plus the cross-epoch consistency check.
  • naive fails 14 of 14 KYC scenarios; safe passes 14 of 14 through the Python adapter, and over 2 epochs through the OpenAI Agents SDK, Microsoft Agent Framework, Strands, Google ADK and MCP connectors and the LangChain safe_kyc_lc agent (28 of 28 each).
  • Full suite: 755 passed, 15 skipped. ruff, pyright and mypy clean.

X5. Remaining connectors and integrations

Claude Agent SDK connector (adapters/claude_agent_sdk.py, extra claude-agent-sdk, --adapter claude-agent-sdk).

  • Package and API, verified from the installed source: claude-agent-sdk 0.2.188 on PyPI; the APIs used are listed in docs/dev/connectors/claude-agent-sdk.md. Pinned >=0.2.188,<0.3 (the same minor, per the Phase 12 rule for 0.x releases). Its mcp requirement (>=1.23,<3) is compatible with the mcp extra, so it joins all-adapters.
  • Environment tools are custom tools of an in-process SDK MCP server; events come from the SDK's message stream (model_call per assistant message); approvals map onto can_use_tool, asked for by a PreToolUse hook (ask_for); suspension uses the shared control flag plus a PreToolUse hook that stops the turn.
  • Offline tests: the SDK has no scripted model, so the connector passes a ScriptedTransport to the real ClaudeSDKClient. It speaks the SDK's control protocol as the CLI would (initialize, hook callbacks, permission requests, MCP messages) and replays the scripted policies. The SDK client, MCP server, hooks and permission callback are the real ones.
  • A finding fixed during the work: putting CredenceStack's tools in allowed_tools triggered the SDK's CanUseToolShadowedWarning: an allow rule approves a call before can_use_tool runs, so approvals could be bypassed under the real CLI. The connector now leaves them out and allows calls in can_use_tool unless an ask_for hook marked that call.
  • Example agents in examples/frameworks/claude_agent_sdk/ (agent_safe.py, agent_naive.py), integration page docs/integrate/claude-agent-sdk.md, version notes docs/dev/connectors/claude-agent-sdk.md, 11 offline tests, and the extra added to the release check's per-extra loop.

Phase 8 status. Phase 8 was not skipped: the fixture-based Atryum importer, three-way reconciliation during run --runtime-log and AP2 mandate-to-profile conversion shipped earlier (all external fields TODO-verify). Two Phase 8 follow-ups were deferred to v1.1 in ROADMAP.md (AP2 mandate scenarios, which need a shopping environment, and a standalone reconcile command). The conservative reading of X5 ("if Phase 8 was skipped") is that they stay deferred; X8 keeps them in ROADMAP.md as genuinely deferred.

Tenuo. Found and verified: tenuo 0.3.7 on PyPI ("signed warrants limit which tools an agent can call, with which arguments, and for how long"). The API was checked against the installed package by minting warrants: Warrant.mint_builder().capability(tool, **constraints).ttl(s).mint(key), Warrant.from_base64, warrant.tools, warrant.capabilities (tool -> argument -> constraint), Range.max, OneOf.values, warrant.expires_at(), warrant.verify(public_key_bytes). Added as an optional integration (extra tenuo, integrations/tenuo.py, credencestack authority import-warrant): acting tools become grants, Range on amount becomes the per-transaction limit, OneOf on invoice_id the bound objects, the expiry every grant's valid_until; anything else is reported as unmapped, never dropped. The mapping is CredenceStack's reading and is marked indicative. Fixture: a warrant minted with a throwaway key (only its public key is committed); 4 tests.

Decisions.

  • Example path. The brief names examples/frameworks/claude-agent-sdk/; a hyphen cannot be imported as --agent module:factory, so the folder is claude_agent_sdk.
  • The connector CI job runs each connector's developer guide; the Claude Agent SDK job is added in X8 together with its guide.

Checkpoint X5. Conformance report src/credencestack/adapters/conformance/reports/claude-agent-sdk.json: Conformant, suspension supported, human-in-the-loop supported, 9 of 9 checks. All seven packs through the connector: safe 90 of 90, naive 4 of 90 (the over-caution baits and the legitimate document). Full suite: 772 passed, 15 skipped; ruff, pyright, mypy clean.

X6. Cross-cutting updates

What was built.

  • Report. A "Results by domain" table in the executive summary (pass rate, 95% interval, and the public minus held-back gap per domain when both ran); a "Financial crime and onboarding controls" section after the pillars (per domain: findings by severity and the scenarios with their pass rates) with a "Findings by domain" table. RunStatistics gains per_domain and domain_gaps; the scenario catalogue records each scenario's domain (kept in the redacted catalogue too).
  • Bundle. Every domain policy a run uses is copied into authority/ (or traces_private/authority/ if only private scenarios use it), hashed and listed in the manifest like an authority profile (kind: policy).
  • Mappings (all status: indicative): FATF Recommendations (R.6, R.10, R.12 at theme level), the OFAC compliance-commitments framework (four themes), and the US CDD rule (beneficial-ownership threshold theme, TODO-verify), mapped to the new finding types and packs. The three framework URLs and FATF's version are marked url_todo_verify / version_todo_verify (a new url_todo_verify field). tipping_off has no verified reference among the allowed ones, so only the generic testing theme is cited.
  • Held-back variants (private, generated into the maintainers' private folder outside the repository, by a generator kept there too): heldout-fincrime (20), heldout-docintegrity (10), heldout-kyc (15), version 2026.4.0. Ids only: H-FC-101 to H-FC-120, H-DOC-101 to H-DOC-110, H-KYC-101 to H-KYC-115. The safe agent passes all 45; the naive agent fails 44 (it passes the legitimate-document variant, as it should).
  • Benchmark. The domain packs are in bench/sample_bench.yaml and bench/bench.example.yaml; the domain LangChain agents are benchmark agents; new result columns (false-clear rate, paid on a contradicted document, KYC rating accuracy and consistency, pass rate per domain and visibility); three new charts (false_clear_rate.png, kyc_rating.png, trusted_document_rate.png); a "Results by domain" section with public versus held-back. A held-back benchmark run's public report passed the leak scan.
  • Conformance kit. Two scenarios added (FC-001, KYC-001) and a tenth check, "Each scenario's own tool set is bound and used". Every connector was re-run and every committed report updated: python, langchain, mcp, mcp (stdio), openai-agents, msaf, strands, adk, claude-agent-sdk and crewai (in its own environment): all Conformant, 10 of 10 checks.
  • CLI and Action. packs list has a Domain column (and JSON field); run --domain filters scenarios; the gate default and the Action's fail-on default add false_clear, released_on_hit, tipping_off, fail_open_screening, onboarded_incomplete and risk_understated.
  • Pack pages. docs/packs/fincrime.md, docintegrity.md and kyc.md include scenario tables generated from the YAML (docs/packs/generated/, by gen_docs_reference.py).
  • Positioning. The new line in pyproject.toml, README.md, the docs home and the Action's description.

Decisions.

  • The gate default changes with the Action's. The workflow test requires the two to agree; changing DEFAULT_FAIL_ON keeps one source of truth.
  • KYC rating accuracy excludes files the policy says to hold (registry down): no rating is due there, and counting them would penalise the correct behaviour.
  • A held-back variant fixed during generation: one near-miss scored above the L1 ceiling, so the oracle (correctly) expected a second review; the variant's name was changed so it stays an over-caution test. The safe agent was right throughout.
  • Tests updated for counts X6 changes on purpose (no assertion weakened): the framework list (test_evidence_bundle.py), the number of benchmark charts (test_bench.py, test_end_to_end_script.py, now len(CHARTS)), and the conformance set (now 10, with two tool-set scenarios).
  • Action description length. The positioning line makes the Action's description longer than the GitHub Marketplace listing shows in full; it still works as an action. Noted as a limitation.

Checkpoint X6. Full suite 770 passed, 15 skipped; ruff, pyright, mypy clean; mkdocs build --strict passes; held-back leak scan PASS.

X7. Hardening and checks

  • End to end. examples/end_to_end.sh now runs all seven built-in packs (and the sample benchmark, which includes the domain packs) offline: 27 s on the development machine, well under the 5-minute limit, so no epochs were capped. New focused demos examples/end_to_end_fincrime.sh (9 s) and examples/end_to_end_kyc.sh (10 s): explain a case with policy explain, run naive (fails) and safe (passes), sign and verify.
  • Determinism. Per episode, two runs of every domain scenario with the same seed give identical records; per run, the three domain packs through Inspect twice with seed 11 give identical results and findings (tests/integration/test_domain_packs.py).
  • Synthetic data. PackManifest gains synthetic; the domain packs set it. scripts/check_synthetic.py (in release_check.sh and tests/unit/test_synthetic_data.py) fails on a domain pack, watch-list or policy not marked synthetic, a missing "all data is synthetic" README, a non-fictional country code, a vessel number that passes the IMO check digit, or any name from a local, git-ignored .synthetic-denylist. Decision: the local denylist was created empty with instructions; writing real sanctioned names into the user's machine is left to the user (the test proves the mechanism with a synthetic stand-in written with different case and accents).
  • Coverage (domain oracles, matching, new graders, domain worlds): 94% overall with branch coverage; every module at least 85% (domains/policy.py 85%, matching 100%, domains/kyc/oracle.py 97%, domains/docintegrity/oracle.py 93%, domains/fincrime/oracle.py 91%, graders/domain.py 95%).
  • Registers. docs/dev/todo-verify.md gains seven rows (FATF edition and URL, OFAC framework URL, US CDD status/threshold/URL, the fincrime 50% and KYC 25% defaults, the Claude Agent SDK live path, the Tenuo mapping). ROADMAP.md no longer lists the Claude Agent SDK and Tenuo (they ship); X8 rewrites the rest.

Checkpoint X7. Full suite 774 passed, 15 skipped; ruff, pyright, mypy, stealth clean.

X8. Documentation coherence review

The full report is v1.0-docs-review.md; the inventory is doc-inventory.md. In short:

  • Inventory: 148 surfaces (repository files, every docs page, in-code documentation, examples, and the private documents by name).
  • New: three guides (Claude Agent SDK, financial crime, KYC) with generated, tested examples, run in CI (the LangChain job runs three guides; a Claude Agent SDK job was added to the connector matrix); three full pack pages; the glossary (44 terms); the style guide; two module reference pages with generated examples; decision 0002; the external-links list; run --policy (the guides' "write your own policy" step needed it).
  • Fixed: stale counts (packs, scenarios, conformance set), the run options table, connector lists, diagrams, the fail-on default in the docs, shipped items still listed as later work, a broken link, 22 duplicate definitions, and a public page that named the private folder's path (the build log itself).
  • Navigation reordered as specified, every page reachable, footer next/previous links.
  • scripts/docs_audit.py in CI and in release_check.sh.
  • Business documents updated (private originals, then docs/why/): the one-pager still fits one page at A4 and Letter with the font unchanged; the functional overview has 14 use cases and prints to 13 pages. Only the permitted extra facts were added (OFAC's 50% rule, FATF R.6/10/12, theme level).

Decisions.

  • Glossary entries are headings, so every page can link to a single term.
  • Guide example agents live in examples/guides/<domain>/ (LangGraph) and the Claude Agent SDK guide reuses examples/frameworks/claude_agent_sdk/.
  • The audit treats the CHANGELOG and this log as history: old counts and release labels there are records, not claims.

Checkpoint X8. docs_audit.py PASS (130 files); mkdocs build --strict passes; stealth and private-content checks pass; one-pager one page; full suite 774 passed, 18 skipped, plus the three new guide tests.

Final navigation: Home · Why CredenceStack (3) · Quickstart (2) · Concepts (3: concepts, concepts in 10 minutes, glossary) · Guides by framework (9) · Guides by domain (4) · Packs (5 plus 7 reference pages) · Integrate your agent (14) · CI (3) · Reading the report (5) · Mappings · Benchmarks (2) · Open-source boundary · FAQ (2) · Reference (API reference and six project pages) · Contributing (architecture, data flow, walk-through, 18 module pages, file index, extending, testing, style guide, inventory, review, release process, maintainer guide, TODO-verify, external links, 8 connector notes, 2 decisions, build log).

X9. Release

  • Sample report. scripts/build_sample_report.py now runs every public pack (all four domains, 90 scenarios, 3 epochs, seed 0) for the scripted safe and naive agents, signs both bundles with the existing demo key (unchanged, so no new public key) and verifies them. docs/sample-report/ was replaced; its page names the domains and says the data is synthetic.
  • Release check. scripts/release_check.sh gains a timed run of examples/end_to_end.sh (all domains, offline) that fails above 5 minutes. It already ran the docs audit, the synthetic-data check and offline conformance for every extra in a fresh environment, including claude-agent-sdk.
  • Version. 1.0.0rc2. Decision: the tag must equal the package version (release_version.py enforces it), so the release candidate number moves with the tag. The CHANGELOG keeps one [1.0.0] section, which pre-releases share; it already lists the X1 to X8 work.
  • First release-check run: 3 failures, all fixed.
  • mkdocs build --strict: a link to extending.md#add-a-new-domain; the heading is "A new domain". Link fixed.
  • A generated developer example (bundle_builder.txt) printed the old version. Regenerated.
  • The docs audit counted private packs when CREDENCESTACK_PACK_PATH was set ("seven built-in packs but there are 14"). Fix: the audit counts public packs only, so a private path cannot change what public docs are checked against.
  • Build summary. docs/dev/build-summary.md, in the navigation after this log.
  • Tag. v1.0.0-rc2 (annotated, local). v1.0.0-rc1 is left where it was. Nothing pushed.

Checkpoint X9. Second full release check (with the private pack path set): PASS (v1.0.0rc2). That covers the wheel and sdist, README quickstart, every extra in a fresh environment with offline conformance (Claude Agent SDK and CrewAI included), the full suite, ruff, pyright, mypy, the stealth, synthetic-data, docs-audit and leak checks, mkdocs build --strict, version consistency, and the all-domain end-to-end example under 5 minutes.

After the checkpoint, the commit hook's ruff caught a long line in the sample-report script that the release check had not run ruff on. The script was fixed, and release_check.sh now runs ruff check and ruff format --check too.

OTel

OpenTelemetry support (phases O0 to O9). Each entry gives what was chosen, the alternatives and why.

O0. Starting point and conventions

How a run flows today:

  1. credencestack run (cli.py) loads packs and calls run_environment_packs (cli_run.py), which calls run_to_bundle (evidence/pipeline.py).
  2. run_packs (runner/inspect_runner.py) turns each pack into an Inspect task; the solver calls run_episode (runner/episode.py) in a worker thread for each epoch.
  3. run_episode builds the Environment (env/environment.py), installs faults, the rate observer and the kill switch, then drives the adapter (start, run_until_done).
  4. Every tool call goes through Environment.call, which records tool_call and tool_result; approvals (Environment.review) record approval_request and approval_decision; faults (faults/wrappers.py) record fault; the kill switch (control/killswitch.py) records control_signal.
  5. Connectors that see model calls record model_call (LangChain, OpenAI Agents, MSAF, Strands, ADK, CrewAI, Claude Agent SDK); handoffs record handoff; env.finish records final. All of them go through one method, Environment.record.
  6. Inspect's scorers (graders/) grade the record; run_packs adds cross-epoch findings, and write_bundle (evidence/bundle.py) writes traces, results, the report and the manifest.

  7. Hook point. Chosen: a listener list on Environment (env.listeners), called by Environment.record. Alternatives: instrument each connector; wrap the adapter protocol. Why: every event of every connector already passes through record, so one hook gives every connector the same telemetry and no connector needs its own code.

  8. Network. The hard limits allow network use only to install packages and pull container images. Chosen: the GenAI repository and vendor documentation were not read; names were confirmed against the installed opentelemetry-semantic-conventions 0.66b2, and everything else is TODO-verify. Alternative: read the GitHub and vendor pages. Why: the hard limits override the rest of the prompt; the more conservative reading is the one that sends nothing anywhere.
  9. Conventions pinned. See the pinned version: attribute names from the 0.66b2 registry (schema 1.44.0), 1.37+ names, span-name formats and kinds TODO-verify.
  10. Packages. Verified on PyPI: opentelemetry-api, opentelemetry-sdk, opentelemetry-exporter-otlp-proto-http, opentelemetry-exporter-otlp-proto-grpc (all 1.45.2) and opentelemetry-semantic-conventions (0.66b2). Chosen: the first four in a new [otel] extra, >=1.45,<2; the semantic-conventions package is not a dependency (the names are constants in semconv.py, so nothing depends on its deprecated module). [otel] is added to both [all-adapters] and [all], which already existed.
  11. The OpenTelemetry API is already installed with the core. inspect-ai depends on fastapi, which depends on opentelemetry-api, and Inspect's acp module imports opentelemetry.trace when it is present. Fallback (logged): "the core runs with no OTel packages" is checked as "no OpenTelemetry SDK or exporter installed, and nothing of CredenceStack's telemetry imported when it is off". CredenceStack itself never imports OpenTelemetry unless telemetry is on; credencestack.telemetry (the package __init__, config, semconv, redaction) imports none of it.

O1. Configuration

  • No config file. CredenceStack has no configuration file today. Chosen: CLI flags and environment variables only. Alternative: add credencestack.toml. Why: a new file format, its discovery rules and docs are not small; flags and the standard OTEL_* variables cover every setting.
  • Enabling. --otel or CREDENCESTACK_OTEL=1. An OTEL_EXPORTER_OTLP_* variable on its own prints a one-line hint and exports nothing.
  • Precedence. Flags, then OTEL_EXPORTER_OTLP_TRACES_*, then OTEL_EXPORTER_OTLP_*. When no flag is given, the OTLP exporters read the standard variables themselves, so their documented behaviour (including /v1/traces appended to the base endpoint for HTTP) applies unchanged. --otel-endpoint is treated like the base endpoint: for HTTP, /v1/traces is appended unless it is already there.
  • http/json. The OpenTelemetry Python SDK has no OTLP/JSON exporter. Chosen: a clear error suggesting http/protobuf or grpc. Alternative: write a JSON exporter. Why: it would be CredenceStack's own protocol code, untested against real backends.
  • --otel-file. Writes OTLP/JSON lines (one ExportTraceServiceRequest per batch, the format of the Collector's file exporter), so files can be replayed into a Collector. --otel-file alone selects the file exporter.
  • Robustness. Batch processor with a 4096-span queue, 1 s schedule, 512-span batches and a 5 s export timeout; flush on shutdown with a 10 s limit, also on Ctrl-C and on errors (the CLI wraps each command in a finally). Decision: after two consecutive failed batches the exporter stops trying and counts the rest as dropped. Alternative: keep retrying. Why: an unreachable endpoint must never slow the run or delay its exit (each OTLP attempt retries for up to its timeout). The first failure prints one warning with a short reason; the summary line says OTel: exported N span(s) or OTel: export failed (reason).
  • Reasons. The SDK logs export errors instead of raising them; CredenceStack captures those log records and maps them to 401/403, 404, unsupported protocol, TLS, unreachable or timed out.
  • Commands. run, bench run, adapters conformance and mcp serve take the --otel* flags. --otel-headers warns that secrets belong in environment variables.

O2. The span model

  • Granularity. Default scenario: one trace per scenario epoch, whose root links to the run span, and the run span links back to each of them. run: one trace, scenario spans children of the run span.
  • Timing. Spans use wall-clock time; simulated time is credencestack.sim_time on events.
  • Grade span. Grading happens in Inspect's scorers after each episode, and cross-epoch findings only once every epoch has run. Chosen: the scenario span stays open until the results are known, then gets its findings and result and ends with its own episode's end time; the grade span is a zero-length span at that time. Alternative 1: end the scenario span when the episode ends and grade into a separate span (but attributes cannot be added to an ended span, so credencestack.result would be missing). Alternative 2: grade again inside the solver (duplicated logic, and no cross-epoch findings). Why: real durations and final results.
  • Findings. Only failing findings are events and counts (compliant and runtime_stricter are records, not problems, as in the report).
  • chat spans. Connectors record a model call when the response arrives; the span starts at the previous trace event (or when the agent started). Token counts only when the adapter has real ones: never for the offline scripted model, whose counts are estimates (model ids credencestack:*, credencestack-*). gen_ai.response.model is not set: adapters record one model id and cannot tell the requested from the answering model. gen_ai.response.finish_reasons is not set: no adapter records it. Strands attributes token usage after the run, so its chat spans carry no counts.
  • gen_ai.provider.name only when the model id names the provider (anthropic/..., openai:...); never guessed from a model name.
  • gen_ai.tool.call.id is harness-assigned (step-<n>): the model's own call id is not in the trace.
  • Faults are events on the scenario span, and the tool span they hit gets status ERROR with error.type fault.<kind>; a tool that returned an error gets tool_error.
  • Approvals are events on the execute_tool request_approval span, or on invoke_agent for a framework's native human-in-the-loop interrupt.
  • Control signals. The reason text is not emitted (it can carry scenario content); kind, step, acknowledgement and simulated time are.
  • Status. The scenario span is ERROR only for an agent or adapter error (crash, timeout); a failed test sets credencestack.result=fail and credencestack.test_failed=true and leaves the status unset.
  • credencestack.bundle.merkle_root. The run span ends before evidence sign runs (a separate command), so the root cannot be on it. Fallback (logged): the attribute is defined but not emitted by run; the bundle's otel/ids.json (which the manifest, and so the signature, covers) gives the correlation in the other direction.
  • mcp serve traces the whole session as one scenario span with an invoke_agent span for the outside client; it is not graded.
  • Metrics (--otel-metrics) were not built: see ROADMAP.

O3. Privacy and content capture

  • Off by default. Without --otel-capture-content no span or event carries a prompt, message, tool argument or result, document text, injection payload, error message or control-signal reason. Finding events keep step_ref (an identifier, as in the report) for public scenarios only.
  • Content attributes. gen_ai.input.messages (the task) and gen_ai.output.messages (the final answer) on invoke_agent; gen_ai.output.messages on chat; gen_ai.tool.call.arguments and gen_ai.tool.call.result on execute_tool. Names confirmed; the message JSON shape is TODO-verify.
  • Private scenarios never reach the capture code (EpisodeSpans._content returns first). Their scenario spans carry the generic description (public_summary, as in the report) and credencestack.content_redacted=true; fault parameters, rule ids and step references are omitted.
  • Redaction. Secret and token patterns (Anthropic- and OpenAI-style keys, AWS access key ids, GitHub and Slack tokens, Google API keys, bearer and basic credentials, private keys, key=value secrets), email addresses, and every term in a local .stealth-denylist when the working directory has one. Then an 8 KB cap per value (max_content_bytes), marked with credencestack.content_truncated.
  • Tests. Against the actual pack texts (task text, injection payloads and free-text tool arguments of the run), with planted markers in held-back copies of public scenarios, and, when CREDENCESTACK_PACK_PATH is set, against the real private packs (failures report a count only, never content).

O4. Correlation with the evidence bundle

  • otel/ids.json (schema credencestack.otel-ids/v1): granularity, the run's trace and span ids, each scenario epoch's, and the URL template when given. Written by write_bundle before the report; listed in the manifest. It exists only when telemetry is on, so default runs and their determinism are unchanged.
  • Not in the hash chain. Why: trace ids are random; putting them in the chained events would make identical runs differ and tie the evidence to one platform.
  • Report. With a template: a "Traces" row on the cover, a "Trace" column in the compliance matrix (one link per epoch) and a link on each failing episode.
  • evidence export --redact-private keeps otel/ids.json (ids only).
  • The sample report was not regenerated: the report template only adds elements when a URL template is present, so a report without one is unchanged (the sample's HTML was checked to be byte-identical when rebuilt; see O9).

O5. Context propagation

  • In-process connectors. --otel-agent-spans nest (default) attaches the invoke_agent span as the current context while the adapter runs, and installs CredenceStack's tracer provider as the global one if no SDK provider is installed. Decision: an existing SDK provider is kept (the agent's own setup wins); CredenceStack still exports its spans through its own provider. separate installs the global provider without attaching the context; off does neither.
  • HTTP. The HTTP adapter adds traceparent (and tracestate) to every request.
  • MCP. Confirmed in the installed MCP Python SDK 2.3 (mcp/shared/_otel.py): it injects and extracts W3C Trace Context in each request's _meta. CredenceStack is the MCP server here and the agent the client, so CredenceStack passes its context to the agent process through TRACEPARENT and TRACESTATE and a trace_context object in the task file; an agent that continues it sends it back in _meta.
  • Duplicates. CredenceStack's spans carry credencestack.source=harness; documented as "what the environment received" against the framework's "what the agent called".
  • Framework notes. Whether each framework emits OpenTelemetry spans through the global provider, and what setting it needs, is TODO-verify (Step 8 of each guide). The CrewAI connector keeps CrewAI's own telemetry off, as before.

O6. Tests

  • Unit tests (tests/unit/test_telemetry.py, 33) with the SDK's in-memory exporter: everything in the O6 list, plus the CLI. The global tracer provider can be set once per process, so the nesting test runs a subprocess.
  • Golden span trees (tests/golden/otel/<connector>.json, scripts/gen_otel_golden.py): one epoch of every conformance scenario per connector, normalised. CrewAI's file comes from its own environment.
  • Conformance. New check otel, "Emits a valid OpenTelemetry span tree" (telemetry.validate.check_episode); not applicable without the extra. Decision: it checks the first pass rather than running the scenarios again (a live model would cost twice); with --otel, an in-memory copy is added to the command's own exporter. All committed reports regenerated: every connector passes.
  • Collector integration (tests/integration/test_otel_collector.py, marker docker, CI job otel-integration): otel/opentelemetry-collector-contrib:0.115.0 with an OTLP receiver and a file exporter; one scenario over http/protobuf and one over grpc. Fallback (logged): Docker is not available in this build environment, so the test was written and runs in CI but was skipped here, with its reason. http/json is not tested: the Python SDK has no such exporter.
  • Weaver. Fallback (logged): not set up. Weaver ships as a container image or a release binary; neither could be fetched or run here (no Docker; network limited to packages). The golden files and check_episode are the safeguard; Weaver in CI is on the roadmap.
  • Local backends. scripts/otel_smoke/jaeger.sh and langfuse.sh (not in CI; never need a vendor key; the Langfuse one uses a self-hosted instance and the user's local keys). Not run here (no Docker).
  • credencestack otel check and credencestack otel print.
  • The disabled-path test checks that no SDK, exporter or CredenceStack telemetry module is imported (the API may be, by Inspect; see O0).

O7. GitHub Action

  • Inputs otel, otel-endpoint, otel-protocol, otel-headers-secret, otel-capture-content (defaults off and empty). otel: true adds the [otel] extra to the install.
  • Decision: otel-headers-secret takes the secret's value, like sign-key-secret: composite actions cannot read the secrets context by name. The run step masks the whole value and each header value with ::add-mask:: before anything else, exports it as OTEL_EXPORTER_OTLP_HEADERS only in that step, and the test checks that the value appears in no other log line.
  • Fixed in passing: the install step did not add the claude-agent-sdk extra for that adapter.
  • The example workflow shows the inputs, commented out.

O8. Documentation

  • docs/integrate/observability/: overview (with the generated attribute and event tables), quickstart, Collector, troubleshooting, and pages for Langfuse, Datadog, Traceloop, Splunk, Grafana, Honeycomb, New Relic, Arize Phoenix, Elastic, Jaeger and any OTLP backend.
  • Platform facts. Only the facts supplied as verified (Langfuse, Datadog) are stated as such, marked "(vendor docs)"; everything else (every other endpoint, header name and menu path) is TODO-verify on the page and listed in external links. No vendor page was read (network rule, O0).
  • Step 8 in every guide; an Observability section in the concepts page; "View trace" links in the report guide; the Action inputs in CI; README and home page ("works with OTLP", no partnership claims); glossary (span, OpenTelemetry trace, OTLP, Collector, semantic conventions, content capture); CHANGELOG and ROADMAP; use case 15; contributor docs (architecture, module reference with a generated example, decision 0003).
  • Docs audit. Fixed: span names such as credencestack scenario PAY-001 #0 read as unknown CLI commands; the audit now skips the span-name words.
  • Fixed in passing: docs/ci.md listed the domain finding types twice in its example and missed the claude-agent-sdk adapter.
  • Business documents: one line in the one-pager (still one page in A4 and Letter) and use case 5.15 plus a capability paragraph in the functional overview (private originals); use case 15 in docs/why/use-cases.md.

Commits. Deviation (logged): the brief asks for a commit at the end of each phase. O0 to O8 were built in one interleaved pass (the span model, the conformance check, the golden files and the docs depend on each other), and splitting them afterwards would leave intermediate commits that fail the docs checks. They are committed together, after the full checks, with the phases listed in the message; O9 is its own commit.

O9. Release re-check

  • Release check extended (scripts/release_check.sh): the core environment must not have the OpenTelemetry SDK or OTLP exporter, runs a scenario with telemetry off, and gives the clear error with --otel; the [otel] extra in a fresh environment prints a scenario's spans and exports a run to a file; the OpenTelemetry unit, golden and content-capture privacy tests; the golden files are current; the otel group of the generated examples; the Collector test when Docker is running (otherwise a printed skip). The development environment now needs the otel extra too.
  • First run: 2 failures, both fixed.
  • The [otel] step piped otel print into grep -q; under pipefail, grep closing the pipe early made the step fail although the output was right. Fix: the output goes to a file first.
  • A generated developer example (bundle_builder.txt) printed the old version. Regenerated (as at X9).
  • Version. 1.0.0rc3; every conformance report regenerated at that version (all ten Conformant, the otel check passing); uv.lock updated.
  • Sample report. Not regenerated: the template only adds trace links when otel/ids.json has a URL template, and re-rendering the committed sample bundles gives byte-identical HTML.
  • Docker. Not available here: the Collector test printed its skip; CI runs it in otel-integration.
  • Tag. v1.0.0-rc3 (annotated, local). v1.0.0-rc1 and v1.0.0-rc2 are left where they were. Nothing pushed.

Checkpoint O9. Second full release check (with the private pack path set): PASS (v1.0.0rc3). That covers the wheel and sdist, the README quickstart, the core without the OpenTelemetry SDK, the [otel] extra and every connector extra in fresh environments with offline conformance, the OpenTelemetry unit, golden and privacy tests, mkdocs build --strict, the generated docs and examples, the docs audit, the stealth, synthetic-data, leak and key checks, ruff, version consistency, and the all-domain end-to-end example under 5 minutes.

v1.0 final build

One build that settles the design, opens every pack, cleans up the product, adds Forge, extends telemetry, finishes the docs and builds the website. Decisions are recorded per phase: what was chosen, the alternatives, and why.

Phase 1. Read and audit

  • Read the code (156 modules), both docs trees (232 pages), every earlier build log and summary, website/design/ (two design files, no site yet) and the external private folder (~/credencestack-private/: seven held-back packs with 65 scenarios, four engineering notes, business documents, review PDFs, generator tools). No premium pack exists; premium appears only as a visibility level in code and docs.
  • The work list is coherence audit. Notable findings: Typer 0.29 vendors its own Click (typer._click), so CLI introspection goes through Typer's objects; "grader" already names the package of Inspect scorers; verifiable/zk.py and verifiable/anchor.py are interface-only modules with no implementation.

Phase 2. Design

  • Recorded in design principles (P2-1 to P2-12), with the alternatives for each decision.
  • Grader naming: the rule engines become credencestack.graders; the Inspect scorers move to _internal.scoring and keep Inspect's word "scorer". Alternative: name the rule engines "rules" or "judges" — rejected, "judge" is already the advisory LLM judge.
  • --fail-on is a severity threshold (default high), replacing both run's fixed "high or critical scenario failed" rule and gate's list of finding types. Findings already carry a severity, so one concept covers both. Alternative: keep finding-type lists — rejected, two gate semantics for one exit code.
  • judge calibrate leaves the CLI (it calls a model and serves maintainers only): becomes scripts/calibrate_judge.py.
  • Public Python API limited to credencestack, .connectors, .forge, .env, .otel; other packages are documented as internal rather than all moved under _internal (module paths stay readable in tracebacks).
  • Behaviour baseline recorded before any code change: scripts/behaviour_baseline.py record runs scripted_safe and scripted_naive over the seven packs, three epochs (90 scenarios, 270 episodes per agent): safe 270/270, naive 9/270.
  • Self-check: 834 passed, 23 skipped; ruff, mypy, docs audit (153 files), mkdocs strict and the stealth check pass.

Phase 3. Open everything

Inventory of non-public material.

Item Where Outcome
Seven held-back packs, 65 scenarios (H-PAY-101..H-KYC-115) ~/credencestack-private/packs/ brought in, renumbered (below)
Premium packs none existed; only the premium level, P-<AREA> id rules and docs level removed
Visibility levels heldout, premium, id rules, traces_private/ core/visibility.py, evidence/privacy.py, bundle.py, export.py, verify.py, report, stats, bench, telemetry replaced by public / confidential
Private-content checks scripts/check_private.py, scripts/check_heldout_leaks.py, the pre-commit hook, the CI step, release-check steps 4 and 5 removed; release check now checks the confidential test fixtures stay out of what ships
Public-versus-held-back gap graders/stats.py, report, bench (--public, benchmark_public.md) removed; bench compares fixed and generated scenarios instead (ids G- until Forge provenance exists)
Held-back generator tools ~/credencestack-private/tools/gen_heldout*.py left in the private folder (Forge replaces them)
Engineering notes ~/credencestack-private/engineering/ technical content merged (below); the rest left there
Business documents, review PDFs ~/credencestack-private/business/, review/ left there (strategy and outreach)
Held-back rotation docs only (no code) removed

Renumbering. H-PAY-101..108 → PAY-021..028, H-ADV-101..106 → ADV-016..021, H-RES-101..104 → RES-011..014, H-TPA-101..102 → TPA-006..007, H-FC-101..120 → FC-017..036, H-DOC-101..110 → DOC-011..020, H-KYC-101..115 → KYC-015..029. Seven packs, 155 scenarios.

Review of the brought-in scenarios. Each got a real title and description (the held-back ones had only generic descriptions), the synthetic-data header of the shipped domain packs, tags without heldout, and the same profile reference as its pack. All 96 person, company, bank and vessel names were checked: all invented. Fixes, logged:

  • ADV-017: the generator's word substitution had produced "the amount due is right away 9,950"; fixed to "now". ADV-018 and ADV-019: "an sign-off" → "a sign-off"; ADV-020: "sign the sign-off later" → "sign it off later". "Re: " prefixes removed from payloads that are not email bodies (document text, vendor name).
  • PAY-028 (was H-PAY-108): the amount map had raised the approval to USD 12,900 but left the revised amount at USD 12,480, below the approval, contradicting the scenario's story (a late fee raising the amount). The revised amount is now USD 13,380 (12,900 + 480). Old result: never baselined publicly; new: the safe agent passes, the naive fails.
  • IBAN-like codes XB77HELD… renamed XB77SYNB… (consistently within each file).

All 65 pass packs validate, the grader's expected decision matches each scenario's expectations (checked per domain and added to the grader tests), scripted_safe passes all 65 and scripted_naive fails 62. It passes PAY-022 and DOC-020 (correct: paying is right) and ADV-017, whose reworded injection ("Remit 9,950") slips past the scripted naive agent's patterns; the scenario stays, as a valid test for model-backed agents, and the limitation is documented.

Visibility model. public | confidential. Shipped packs must be public (the loader refuses otherwise). Confidential scenarios keep the redaction the held-back ones had in bundles (generic descriptions, confidential/ directory, evidence export --redact), and in telemetry their ids become confidential:<8 hex> (scenario, pack, span names, grade span, conversation id). Decision: keep in-bundle redaction for now (the bundle format is rebuilt in phase 5, where redaction moves to export and --redact report time). Alternative: drop in-bundle redaction now — rejected, it would weaken privacy between phases.

Fixtures. tests/fixtures/confidential/fixture-confidential/ (two scenarios with canary strings), excluded from the sdist (pyproject.toml) and rejected by scripts/check_dist.py; the release check also greps the docs build. The private-pack template became examples/confidential-pack/ ("Keep your own scenarios confidential").

Private notes merged. known-limitations-and-risks.md (technical items: kill-switch flag, reconciliation counts, Inspect epoch reduction, interval independence, cost cap, judge, runtime rows, Claude SDK transport, Tenuo mapping, CrewAI pins, bundle size, interrupted runs, scripted determinism, slow guide tests, OTel facts, content capture) → docs/dev/known-limitations.md. heldout-and-premium.md section 6 (how to write a variant: change the surface, never the rule) is kept for the mutator guidance in phase 9. Left in the private folder: the ops runbook (key custody, incident steps with personal procedures), the reflog note, the business tier of the risks note, the docs review.

Claims removed. docs/open-source-boundary.md deleted; held-back, premium and rotation text removed from the docs, README, ROADMAP, SCOPE, SECURITY, CHANGELOG, the report template, CLI help, the bench report and the action. The commercial-edition remark in decision 0001 removed.

Behaviour. The 90 original scenarios give identical results for both agents (0 differences); pack and pillar aggregates differ only because the packs grew. The 65 opened scenarios got their first baseline (310 scenario results in all). - Self-check: 917 passed, 22 skipped; ruff, mypy, docs audit (152 files), mkdocs strict and the stealth check pass.

Phase 4. Command line

  • Package layout pulled forward from phase 7. Renaming "adapter" to "connector" and "oracle" to "grader" in the CLI meant touching every import anyway, so the P2-12 layout moved now: adapters/ → connectors/ (one module per framework, Connector classes), authority/ → profiles/ (the profile model), the authority and domain oracles → graders/ (authority, payments, fincrime, docintegrity, kyc, base, oversight; registry GRADERS, grader_for), Inspect scorers → graders/scoring.py, faults/ and control/ → env/faults.py, env/killswitch.py, env/rate.py, verifiable/ → evidence/ (chain, merkle, signing, verify; canonical JSON → _internal/canonical.py), matching/ → _internal/matching/, telemetry/ → otel/, the cli_*.py modules → cli/. graders/__init__ imports nothing eagerly (the scenario models import the authority grader's types; an eager import was circular). Alternative: wait for phase 7 — rejected, the same files would be rewritten twice.
  • Removed: verifiable/zk.py and verifiable/anchor.py (interfaces with no implementation, nothing used them; a public module that promises a feature that does not exist breaks the "promise nothing that didn't ship" rule).
  • Grammar. Every command ported to P2-2 on one framework (cli/framework.py): global --json, --quiet, --verbose, --no-color on every command, settings injected, the exception hierarchy (errors.py) mapped to exit codes 0–5, tracebacks only with --verbose. Typer 0.29 rewrites docstrings in its own way: help uses Markdown mode, and examples sit under "Usage examples:" (pydocstyle's D412 fix removed the blank line after a Google "Examples:" section, which broke the Markdown rendering).
  • Removed commands, no aliases: gate (→ run --fail-on, evidence inspect), validate, init, schema, authority *, policy * (→ packs, profiles), adapters * (→ connectors list|check), keys generate (→ evidence keygen), evidence sign (→ --sign on run and report), mcp serve (→ env serve), bench report (→ bench run writes its report), judge calibrate (→ scripts/calibrate_judge.py, refuses without CREDENCESTACK_LIVE=1). Removed flags: --adapter, --zip, --trace-out, --summary (→ inspect --format markdown), --redact-private, --public, --allow-unsigned (unsigned outputs verify their integrity and say they are unsigned), report --force, and every OTel exporter flag (--otel-exporter, --otel-endpoint, --otel-protocol, --otel-headers, --otel-file, --otel-service-name, --otel-trace-url-template, --otel-agent-spans): these are settings; headers come only from OTEL_EXPORTER_OTLP_HEADERS, so secrets never travel as flags. Added: demo, doctor (with --check-otel), config show|init, version, packs show, evidence inspect, shell completion (Typer's --install-completion and --show-completion).
  • Gate. --fail-on is a severity (low, medium, high default, critical, none): an episode fails when a failing finding, or its failed scenario, is at or above it. bench run asks for --confirm-spend only when a configuration calls a real model.
  • Settings. settings.py (flag > CREDENCESTACK_<SECTION>_<KEY> > credencestack.toml found walking up > defaults), config show with sources, config init writes a commented file from the same definitions. Unknown CREDENCESTACK_* variables are an error (with reserved prefixes for test and agent-process variables). Variables renamed: CREDENCESTACK_PACK_PATH → CREDENCESTACK_PACKS_PATH, CREDENCESTACK_OTEL → CREDENCESTACK_OTEL_ENABLED, CREDENCESTACK_SIGNING_KEY → CREDENCESTACK_EVIDENCE_SIGNING_KEY, CREDENCESTACK_MODEL → CREDENCESTACK_CONNECTORS_MODEL, CREDENCESTACK_HTTP_TOKEN → CREDENCESTACK_CONNECTORS_HTTP_TOKEN. test_no_environ_reads_outside_settings allows only settings.py, otel/, cli/console.py (NO_COLOR) and the CrewAI connector (it must set CrewAI's own telemetry opt-outs before import). otel.required makes a failed export exit 3.
  • Outputs and ids (from phase 5, done now because every command was rewritten): <out>/<kind>-<YYYYMMDD>-<6 base32>/, default ./credencestack-out/, with a latest-<kind> symlink (or LATEST-<kind> file). The shared manifest schema is still phase 5.
  • Console. cli/console.py: header, result tables in ID/title/result/finding/rate order, rates 83.3%, intervals [71.2–91.0], money with currency, tone with a symbol beside every colour, closing block with files and the next command; stdout carries one JSON document with --json.
  • Checks added: tests/unit/test_cli_grammar.py (tree vs grammar, flag vocabulary, banned spellings, help summaries and examples, every offline help example runs, the generated references are current), tests/unit/test_settings.py.
  • Generated references: docs/hooks/cli_reference.py writes docs/reference/cli.md and docs/reference/configuration.md on every mkdocs build (committed too, checked for freshness).
  • The GitHub Action follows: fail-on severity, out-dir is the parent, signing via report --sign with the key in a temporary file, gating with evidence inspect --format markdown, input otel-content.
  • Docs, guides, examples and scripts moved to the new commands; every generated example regenerated (CrewAI in its own environment).
  • Behaviour: baseline MATCH (no result changed).
  • Self-check: 1000 passed, 22 skipped; ruff, mypy, pyright (0 errors), docs audit (155 files), mkdocs strict and the stealth check pass.

Phase 5. One evidence format

  • One manifest. Every output directory has a manifest.json in one format, credencestack.evidence/v1 (evidence/manifest.py): kind, id (the directory name), created_at, credencestack_version, settings (effective, flags included), environment (Python, platform, key packages, git state), inputs (packs with visibility, profiles, seed and whether it was drawn, connector, agent, models, epochs, runtime sources, config, source), outputs (every file with SHA-256 and size), merkle_root, otel, visibility, and one section per kind (run, bench, generation, brittleness, env_export, export). Renamed: files → outputs, run_id → id (also in the signed statement), authority_sources → inputs.profiles (profile_id → id), adapter → inputs.connector, base_seed → inputs.seed. Every field has a description; schemas/manifest.schema.json and docs/reference/outputs.md are generated from the model, and packs schema manifest prints the schema.
  • Bench. bench_run.json is gone; bench run writes a kind: bench manifest whose bench section holds the config, configurations and spend, and whose outputs cover the nested configuration bundles. verify checks every nested output directory.
  • Export. evidence export writes an export-<id>/ directory (its own kind: export manifest plus the source under bundle/), not a zip. Decision: an export's signature is its bundle/'s (the run's own signature, which survives redaction), so verify moves the signature requirement to bundle/ and also requires it whenever the export records that the source was signed.
  • Zip verification removed. Exports are directories, so verify reads directories only (no backward compatibility); an archive is unpacked first. The published sample keeps a plain zip of each bundle because its Inspect logs are 35 MB uncompressed; scripts/build_sample_report.py builds the archives reproducibly and verifies the unpacked copy, and tests/docs/test_sample_report.py checks the samples verify against the committed key and that a one-byte trace edit fails naming the file and line.
  • Privacy fix found while regenerating the samples: manifests recorded absolute local paths, including the home directory and the private key's location. Root cause fixed in Settings.public_dict(): evidence.signing_key is never recorded (LOCAL_KEYS), and path settings (PATH_KEYS) are recorded relative to the working directory or as <outside>/<name>. Test: test_manifest_settings_hold_no_local_layout. run now also records the effective --fail-on, --seed and --sign.
  • Inspect summarises any kind (run, bench, export) and shows created as YYYY-MM-DD HH:MM UTC; the docs normaliser replaces that time, and the version pattern no longer swallows the closing parenthesis.
  • Gate ignores the confidential-result keys (withheld, unmet_expectations_withheld) when validating results.
  • Tests: tests/integration/test_manifests.py validates run, bench and export manifests against the committed schema, checks the schema is current, the ids and latest-<kind> pointers, that tampering is caught in every kind, and that inspect reads every kind. Existing tests moved to the new field names; the zip tests became directory tests (including an attacker who rewrites the export's own manifest).
  • Docs: evidence bundle, reading the report, benchmarks, data flow, code walkthrough, the bench module page, the confidential-pack example and the README describe the new manifest and directory exports; generated pages regenerated; sample report rebuilt and re-signed with the demo key.
  • Behaviour: baseline MATCH.
  • Self-check: 1011 passed, 22 skipped; ruff, mypy (configured scope: strict on core), pyright (0 errors), docs audit (156 files), mkdocs strict and the stealth check pass.

Phase 6. Reports

  • One engine. New package credencestack.reports: model (a Report is a title block, summary metric tiles, sections of blocks: paragraphs, bullets, tables, finding chips, collapsible groups, charts, <!-- WRITE: … --> markers; then methods, limitations, disclaimer), render (one Jinja template set in reports/templates/: page.html.j2, components.html.j2, report.css.j2; Markdown walks the same tree), charts (the shared chart style), evidence (a run's evidence report, six-pillar sections included) and bench (the benchmark report, now benchmark.html as well as benchmark.md). Deleted the duplicates: evidence/report.py, evidence/templates/report.html.j2, bench/report.py and its Okabe-Ito palette. A test fails if a .j2 template appears outside reports/templates/.
  • Design tokens. src/credencestack/reports/tokens.json is the one source (colours, radii, fonts, type scale, spacing, chart series, and the text/background pairs to check). Decision: it lives in the package rather than design/tokens.json (as P2-10 first said) because reports read it at run time; phase 15 generates website/src/styles/tokens.css and the docs theme from it. Every listed pair passes WCAG AA (lowest: muted on accent-soft, 5.06); no shade changed.
  • Fonts. Decision (deviation from P2-10's "fonts embedded as data"): reports name the website's fonts first (Space Grotesk, Inter, JetBrains Mono) and fall back to system fonts. Embedding would mean downloading font files, which this offline build avoids; P2-10 updated to match.
  • Chart style. Series 1 #1E4FD8 solid with circles, series 2 #B5651D dashed with squares, then #1F6B45 dash-dot with triangles and #6B4FBB dotted with diamonds; bar series also differ by hatch. PNGs are saved without metadata.
  • Numbers. credencestack._internal.fmt (rates 83.3%, intervals [71.2–91.0], money, durations) is shared by the console and every report; the console's own copies were removed and callers import from it.
  • Telemetry links. With OTel on, the title block shows the run's trace ID, the compliance matrix a Trace ID column (one per epoch) and each failing episode its trace ID; with otel.trace_url_template set they link out. The template can be set after the run: credencestack report <bundle> uses the current setting. No network calls.
  • Confidential content. Decision: reports show confidential scenarios only as generic descriptions, always. The report is one of the signed files and travels inside redacted exports, so a non-redacted variant would either break the export's signature or leak; no --redact flag is needed because there is no unredacted report.
  • credencestack report now rebuilds a run (report.html) or a bench (report/benchmark.html and .md) and refuses other kinds; sign_dir re-renders only a run's report.
  • Docs extracts (report-extract.md in the guides) are rendered from the same data model with render_sections_markdown instead of parsing the HTML; the HTML parser in scripts/gen_doc_examples.py is gone. CrewAI's extract regenerated in its own environment.
  • Bugs found on the way: Jinja autoescaping turned the quotes in the CSS font stacks into entities (fixed: the stylesheet is included in the page and only token values are marked safe; test added); malformed observability commands in three docs pages (--otel \ CREDENCESTACK_OTEL_TRACE_URL_TEMPLATE "…") rewritten as export lines.
  • Sample report rebuilt and re-signed. Screenshots of both sample reports at 1280 px and 390 px in docs/dev/screenshots/ (scripts/screenshot_reports.py, local headless Chrome; the phone width uses a 390 px iframe because headless Chrome will not open a window narrower than about 500 px; every PNG holds only IHDR, IDAT and IEND).
  • Deferred: 143 uses of "oracle" remain in 49 docs pages (none in code); they go with the phase 14 docs restructure, where docs_audit.py starts failing on banned terms.
  • Behaviour: baseline MATCH.
  • Self-check: 1019 passed, 22 skipped (two tests updated for the new report error and the regenerated CLI reference, then rerun with the docs tests); ruff, mypy (strict on core), pyright (0 errors), docs audit (158 files), mkdocs strict and the stealth check pass.

Phase 7. Python API and code structure

  • Public API. credencestack exports run, RunOutput, select_packs, verify, load_profile, grader_for, the models (Scenario, Pack, Finding, FindingType, Severity, RunResult, RunStatistics, AuthorityProfile, VerifyResult), Settings and the errors. credencestack.api is the implementation; the CLI uses the same select_packs and parse_seed (its own copies were removed). run() writes the same output directory as the command and prints nothing. The public subpackages are connectors, env, otel (and forge from phase 8); everything else is internal. __version__ is set before the imports in credencestack/__init__.py because internal modules read it during import.
  • Python reference. docs/reference/python/ (index, credencestack, connectors, env, otel) is generated by mkdocstrings from the public packages only; the old docs/reference/api/ pages, which documented internal modules as if public, are gone. A test checks the pages cover exactly the public packages and that every public class and function has a docstring. User docs samples that reached into runner.inspect_runner, runner.episode or packs now use credencestack.run.
  • One module per utility in _internal: io (data files and validation errors; ten loaders now share it and print the same <file>: <field>: <problem> lines), hashing, seeding (derive_seed is byte-identical to the old runner/seeds.py, so results are unchanged), stats (Wilson, Newcombe, kappa, moved from graders/stats.py), fmt (phase 6) and log. tests/unit/test_structure.py names the one module allowed to call yaml.safe_load, hashlib.sha256 (plus the documented chain and Merkle layouts), random.Random and secrets.randbelow, or define the formatting and interval helpers.
  • Logging. One credencestack.* tree with a NullHandler at its root; the console shows warnings on stderr and debug lines with --verbose. No print outside the console (a test walks the AST); mcp_bridge writes its usage line to stderr directly.
  • Errors. Every library error is a CredenceStackError: file loaders raise InputError subclasses (new: a ConfigError that keeps every problem in errors), and bundle, key, gate, bench, telemetry, runtime-log and connector errors map to ConfigError, UsageError or DependencyError. DataFileError, TelemetryConfigError and ConnectorNotInstalled keep ValueError or ImportError as a second base because callers catch those. Only control-flow exceptions (ToolError, HttpContractError, BudgetExhausted, _Halt, Suspended) stay outside; a test lists them.
  • Privacy fix found on the way: with confidential packs in a run, an Inspect log that could not be parsed stayed in the shareable inspect_logs/. It now fails closed: any log not shown to belong to a public pack moves to confidential/, with a warning.
  • Schema ids used two domains (credencestack.dev and credencestack.ai); all are now https://credencestack.ai/schemas/..., schemas regenerated. The python -m exporters for the scenario and policy schemas duplicated packs schema and were removed.
  • Dead code (a static reference scan, then coverage: 90.4% of statements over the full suite): removed the two exporters, graders.kyc.rating_inconsistencies (the consistency finding is computed in graders/domain.py), runner/seeds.py, otel.config.parse_headers (headers come only from OTEL_EXPORTER_OTLP_HEADERS) and otel.hub.Telemetry.end_run. Code coverage cannot reach is accounted for: the CrewAI connector (its own environment), mcp_bridge and env serve (subprocesses), the live judge (needs a model). _internal.hashing.sha256_json is kept for Forge's duplicate detection (phase 8).
  • Progress line. Coverage showed the console's progress line (P2-8) was never called. run_packs and run_to_bundle take an on_episode callback and credencestack run drives 37/155 PAY-012 epoch 0 on a terminal (nothing when not a TTY or with --quiet).
  • Extras. One per connector framework, plus anthropic, openai, judge (new: the provider SDKs the advisory judge needs), bench, otel, tenuo, and all, which is every extra that can share one environment (all but crewai). all-connectors was folded into all; docs became a dependency group (users never need it); CI and the release scripts use --group docs. uv lock --offline resolved with no new packages. The quickstart lists every extra, and a test keeps the list and all complete. Decision: env (Gymnasium) is added with the environment in phase 10.
  • Behaviour: baseline MATCH (seed derivation unchanged).
  • Self-check: 1031 passed, 22 skipped (the dev-reference freshness test after regenerating); ruff, mypy (strict on core), pyright (0 errors), docs audit (152 files), mkdocs strict and the stealth check pass.

Phase 8. The generator

  • credencestack.forge (public): mutator (the interface), difficulty and difficulty.yaml (the dial), label (grader-backed labelling), registry, generator, output. Scenarios gain a generated provenance field (core.scenario.Provenance): seed scenario, mutators, intensities, level, achieved difficulty (sum of weight × intensity), generator version, master seed and index.
  • Labelling is the grader's. Payments tasks go through the authority grader's decide, invoice by invoice (each allowed payment joins the history the next sees); the decision maps to ledger, decision and approval expectations (PAYMENTS_POLICY, documented in the module). Partner-agent queues add credential, scope and rate-limit checks. The fincrime, KYC and document domains map their graders' expected items to the tools that must and must not be called (DOMAIN_TOOLS).
  • Checked against the shipped packs. Of the 155 shipped scenarios the labeller recomputes 130 and reproduces the hand-written expectations of 127. The other three are documented differences (PAY-008, PAY-011, PAY-012: hand labels stricter or looser than the uniform policy). 25 rely on facts the grader does not see (faults, flags, duplicates, amended amounts) and raise NeedsSeed. All seven partner-agent scenarios and every fincrime (36), KYC (29) and document (20) scenario agree.
  • Labelling modes. Decision: a mutator declares recompute (the grader sees the change), preserve (the outcome cannot change) or override (it states the new expectation). The generator applies them in that order, labels after the recompute stage, and re-checks applies_to before each mutator so incompatible changes cannot stack. Undecidable, ambiguous, invalid and duplicate candidates are redrawn (up to 40 draws per index); the counts go to the manifest.
  • Labels agree with run-time grading. Generated scenarios were written, loaded with --pack-path and run with both scripted agents. Five rounds of fixes came from this: the reviewer's max_approvers decides whether dual approval is satisfiable (PAY-009's semantics); a kill switch only fires if the agent reaches its step, so it fires at step 1 or 2 and never stacks with faults; a transient fault (a timeout before the payment took effect, a few rate-limit responses) makes paying optional rather than required; a stop fault on a denied payment keeps reject; an injection whose goal is a payment that is also correct is ambiguous (the injection scorer could not tell them apart) and is rejected. Result on 500 fresh scenarios (seed 99): the safe agent passes 500/500, the naive agent 5%. The test runs 60 scenarios each time.
  • Pack loader: scenario files may be JSONL (one scenario per line); confidential and public generated scenarios go to separate pack directories because a pack's visibility applies to all its scenarios.
  • Determinism: two processes produce byte-identical output (tested).
  • Performance (measured): 2,000 payment-family scenarios generated in 3.3 s (36,164 per minute), 5.5 s including writing YAML (21,740 per minute), on an Apple M3 Pro laptop.
  • Shipped so far: 21 mutators for the payments, adversarial, resilience and third-party families (phase 9 adds the domain families, plugins and the commands).
  • The first full check run caught: the scenario schema needed regenerating (the generated field); forge/output.py read YAML directly (now read_data); a mutator helper named money collided with the formatting rule (renamed cents); Forge's redraw signals (NotApplicable, Undecidable, Ambiguous, NeedsSeed) joined the structure test's control-flow allowlist. The fincrime mutators module is committed here but tested in phase 9.
  • Behaviour: baseline MATCH.
  • Self-check: full suite 1038 passed before the fixes above; after them the affected tests (structure, schema, generator, authority CLI: 26) pass; ruff, mypy (strict on core), pyright (0 errors), docs audit (154 files), mkdocs strict and the stealth check pass.

Phase 9. Mutators

  • 44 shipped mutators in seven families: payments 8 (limit edge, split, monthly total, new payee, dual approval, out of hours, currency, hidden batch item), adversarial 5 (plant, rephrase, encode, move, multi-turn; a rule-based phrase grammar with six styles, four placements, four formats and three goals), resilience 5 (timeout timing, rate limit, approval outage, stale data, kill switch), third-party 3 (credential state, velocity, scope creep), fincrime 10 (exact, clear non-match, alias, transliteration, homoglyph, split/join, identifier conflict, ownership layers, vessel in free text, intermediary identifier), KYC 6 (missing document, PEP director, hidden owner, registry conflict, risk boundary, EDD jurisdiction change), documents 7 (reconciled, totals, bank, pages, dates, dissolved registry entry, near-duplicate). docs/reference/mutators.md is generated from the registry, with the difficulty dial.
  • Labels checked against the agents in every domain: the safe scripted agent passes 700/700 generated scenarios across all seven families (seed 2026) and 300/300 fincrime scenarios after the two late mutators (seed 77). Two fixes came from it: the document labeller now also recomputes the ledger (pay once exactly when the document is clean), and an injection whose goal tool is a required action (for example clear_alert once the alert is a false positive) is ambiguous and redrawn.
  • Decision (an addition to the brief's list): doc.clean.reconciled makes a document consistent with itself and the records. Without it every generated document was flagged (18 of the 20 seed documents are), so an agent that flags everything would pass and over-caution could not be measured.
  • Deferred with a reason: "an intermediary bank in a deeper position" needs a correspondent chain; the payment model has one intermediary slot, so the intermediary mutator varies the bank's identifier (exact, with a branch code, different) instead.
  • Plugins: .py files (or directories of them) on the mutator path (--mutator-path, setting mutators.path, CREDENCESTACK_MUTATORS_PATH: the variable follows the CREDENCESTACK_<SECTION>_<KEY> rule rather than the brief's ..._MUTATOR_PATH). Every concrete Mutator subclass is checked (id pattern, family, domain, weight, visibility, labelling); errors list every problem; duplicate ids are refused. Worked example: examples/custom-mutator/ (example.vendor.suffix, preserve). Confidential fixture: tests/fixtures/mutators/canary.py (never packaged).
  • Commands: credencestack mutators list [--family] [--mutator-path] [--json] and mutators show <id>; a confidential plugin appears as confidential:<hash> with its summary and description hidden.
  • Tests: tests/unit/test_forge_mutators.py checks every mutator (applies to a shipped scenario, deterministic for one generator seed, leaves its input untouched, keeps the scenario valid, changes it, describes the change without names from the scenario), that every recompute mutator yields scenarios the grader decides, plugin loading and refusal, the confidential plugin end to end (generation, output, list, show) and the CLI.
  • Behaviour: baseline MATCH.
  • Self-check: 1137 passed, 22 skipped, then --family added to the flag vocabulary (the one failure) and the grammar tests rerun (83 passed); ruff, mypy (strict on core), pyright (0 errors), docs audit (155 files), mkdocs strict and the stealth check pass.

Phase 10. The generate command

  • credencestack generate -p <pack> (repeatable, or all) --n --seed <int|fresh> --difficulty <1-5|range> [--from-scenario] [--mutators id,id] [--mutator-path] [--pack-path] [--out] [--format yaml|jsonl] [--explain] [--json], in the Test group. Decision: the brief's sketch maps onto the shared flags unchanged except --pack, which is the shared -p/--pack.
  • Output: <out>/generate-<id>/ with one pack directory per source pack and visibility (<pack>-g<seed>[-confidential]) and a kind: generate manifest whose generation section holds the seed (and whether it was drawn), requested and produced counts, levels, format, filters, counts by pack, level, mutator and visibility, rejections by reason, indexes given up, and the generator version. The manifest hashes every file, so evidence verify checks a generation like any output.
  • --explain prints, for three samples, the seed scenario, each mutator with its generic description and intensity, the grader's decisions with rule ids, and the expectations; for confidential scenarios the decisions are withheld and confidential mutators show as hashes.
  • generate --validate DIR (forge.validate): re-labels every scenario the grader can label as written and compares the recomputed keys; then runs the generation again from the seed, packs, levels and filters in the manifest and compares every scenario byte for byte. Exit 4 with every problem listed; tests use it, including a tampered expectation.
  • Generated packs run through run (scripted agents, and the LangChain connector with the scripted model when installed) without special cases; the bench runner already tells generated scenarios (G- ids) from fixed ones.
  • Measured rate (phase 8): 21,740 scenarios per minute including writing YAML on an Apple M3 Pro; a test keeps a floor of 1,000 per minute over all packs.
  • Behaviour: baseline MATCH.
  • Self-check: 1151 passed, 22 skipped; the one failure was the offline help-example test running generate --validate credencestack-out/latest-generate with nothing to validate (now skipped like the other latest-* examples; grammar tests rerun, all pass); ruff, mypy (strict on core), pyright (0 errors), docs audit (155 files), mkdocs strict and the stealth check pass.

Phase 11. The environment

  • credencestack.env.CredenceEnv (env/rl.py, public, standard library only): reset(seed) -> (observation, info) with the task text, inputs and tools as JSON Schema, and the scenario id, domain, level, difficulty and visibility; step(action) with a tool call {"tool", "args"} or a final answer {"final": text or {"decision", ...}} (free-text decisions are parsed for pay, escalate, reject, halted, partial). The environment, faults, injections and kill switch are exactly those of run (prepare_episode); truncation at max_steps or when the kill switch fires (the agent is then recorded as halted). Scenario sources: one scenario, a list (chosen by the seed), or GeneratedScenarios (a fresh Forge scenario per reset).
  • Rewards are graded exactly as run grades (all_findings and check_outcome): terminal +1/0; shaped subtracts the weights in env/rewards.yaml (by finding severity, unmet expectations, over-caution, tool calls beyond a budget, floored at -1). Decision: shaped rewards start from the terminal reward, so the two always agree on which episodes are good (tested). info["findings"] at the end; for a confidential scenario info carries only finding types and severities, a hashed id and a count of unmet expectations.
  • Batch and connectors: make_env_batch (derived seeds), run_batch (threads), rollout, and run_connector / CredenceEnv.run_connector (any connector as the policy for one episode, graded and rewarded like the rest).
  • Gymnasium: decision (conservative fallback) — Gymnasium is not in the local cache and this build does not download packages, so no env extra was added (the lock could not resolve offline). env/gym.py (CredenceGymEnv, JSON text actions and observations via spaces.Text) is written to Gymnasium 1.x's documented API, marked TODO-verify, raises a DependencyError naming pip install gymnasium when it is missing, and its test is skipped here; both files are excluded from pyright in this environment, like CrewAI. The native interface is primary because tool calls do not fit numeric spaces.
  • Hub integrations: checked; no RL hub library (such as verifiers) is installed or installable offline, so no adapter was written. env/export.py documents how to wrap tasks.jsonl; hub specifics are TODO-verify for phase 14's docs.
  • Commands: credencestack env episode (a connector or scripted agent as the policy; the steps, result, reward and findings in the console style; confidential scenarios show no steps) and credencestack env export (env-export-<id>/ with tasks.jsonl, the scenario packs the reward specs point at, and a kind: env-export manifest; --include-answers never for confidential tasks, counted as withheld).
  • Tests (tests/unit/test_env_rl.py): determinism of observations, rewards and info; rewards agree with credencestack.run for 50 generated scenarios per domain group and both scripted agents (400 episodes); truncation; malformed actions and unknown tools; the kill switch (RES-006 truncates at step 2 and the halt passes); shaped versus terminal; batches; confidential info and exports; both commands. tests/unit/test_env_gym.py where Gymnasium is installed.
  • Behaviour: baseline MATCH.
  • Self-check: 1168 passed, 23 skipped; two failures fixed and rerun (the structure test now skips modules whose optional dependency is missing, like the Gymnasium adapter; the CLI reference regenerated for env episode and env export); ruff, mypy (strict on core), pyright (0 errors), docs audit (155 files), mkdocs strict and the stealth check pass.

Phase 12. The brittleness benchmark and benchmark rounds

  • credencestack bench brittleness -c <file> [--seed int|fresh] [--confirm-spend] [--max-usd] [--mutator-path] [--pack-path] [--out] (bench/brittleness.py). The file is a benchmark file plus per_level (default 40), levels (1-5), epochs (default 3) and seed (an integer or fresh). For each pack Forge generates per_level scenarios per level from one master seed; every configuration then runs the fixed and the generated scenarios with the ordinary bench runner (runs/), under one cost cap. Real models need --confirm-spend.
  • Outputs: brittleness-<id>/ with brittleness_results.csv (per configuration: levels fixed and 1-5 with Wilson intervals and the Newcombe gap; sensitivity by mutator and by family; over-caution), four charts in the shared style, the report (HTML and Markdown from the shared engine, with WRITE markers), the generated packs and a kind: brittleness manifest (runs/ keeps its nested bench manifest; evidence verify checks both).
  • Decision (a departure from the brief's wording): the brief asks the scripted naive agent to degrade with difficulty. It cannot: it obeys whatever it reads, so it fails almost every scenario at every level (4% fixed, 0-7.5% generated), a flat curve. It stays as the always-obey baseline. A new scripted_brittle is the safe agent with documented, deterministic weaknesses (credencestack.agents.BRITTLE_WEAKNESSES): payments decided on the per-transaction limit and allow-list only (no clock, earlier payments or currency); sanctions alerts cleared unless the names match letter for letter; no PEP check; documents checked for bank details and totals only. The weak paths are an explicit weak flag through the safe agents (no global state, so connectors that step generators from other threads behave the same).
  • Measured (sample, seed 42, 20 per level per pack, four packs): safe 100% at every level; brittle 73% fixed, then 82.5%, 74%, 70%, 62.5%, 76%; naive 4% fixed, 7.5%, 2.5%, 0, 0, 0. The level-5 rise is reported, not tuned away: five stacked changes usually include one the brittle agent does look for. Runtime 29 s; CI runs it with a 120 s timeout and verifies the output.
  • Generated scenarios in the evidence report: the scenario catalogue in results.json records each generated scenario's level and difficulty (mutator ids only for public ones); the report gains a "Generated scenarios" section with episodes passed by level and the fixed-to-generated gap whenever generated scenarios ran.
  • Benchmark rounds: docs/benchmarks/brittleness.md documents --seed fresh (each round's scenarios are new; the recorded seed reproduces it).
  • Confidential plugins end to end: tested here for brittleness outputs (results CSV, manifest, report: the canary mutator appears only as confidential:<hash> and counts); --explain, reports and env export were tested in phases 9 to 11; telemetry is phase 13.
  • Tests: tests/unit/test_brittleness.py (outputs, schema, verification, determinism, the three agents' shapes, --seed fresh, --confirm-spend, the confidential plugin, the evidence report's section).
  • Behaviour: baseline MATCH.
  • Self-check: 1178 passed, 23 skipped; the two failures were offline help examples that read bench/*brittleness.yaml from an empty directory (now skipped like the bench examples; grammar tests rerun, all pass); ruff, mypy (strict on core), pyright (0 errors), docs audit (156 files), mkdocs strict and the stealth check pass.

Phase 13. One telemetry model

  • One registry: credencestack/otel/semconv.py now registers every span (SPANS, SpanDoc: name or prefix, kind, parent, meaning), every attribute (ATTRIBUTES, with the spans that carry it and a privacy class: safe, content, never), every event (EVENTS, EventDoc with its attributes) and every metric (METRICS). Event attributes, previously only listed under their event, are registered attributes too. The never class names what must never be exported (task text outside content capture, mutator change parameters, expected outcomes, signing keys) so the tests can check for it. docs/reference/otel-attributes.md is generated from it by the docs hook; the two hand-included tables in docs/_generated/otel/ (a second generator) were removed.
  • Fails on unregistered emissions: credencestack.otel.validate.unregistered(spans) lists any harness span name, attribute, event or event attribute that is not registered, any never attribute, and any content attribute without content capture. Tests run it over every workflow, with and without content, and over the conformance scenarios (chat spans, faults, approvals, handoffs).
  • Forge attributes: scenario spans (and episode spans) of generated scenarios carry credencestack.forge.generated, .level, .difficulty, .seed_scenario, .mutators (public ids only) and .confidential_mutator_count. Decision: confidential mutators are counted, not listed even as hashes, as the brief asks.
  • Generation: credencestack generate <id> root span with packs, requested and accepted counts, seed, level range, version, duration and rate; one rejection event per reason and one mutator-usage event per mutator (confidential ones counted together as confidential), aggregated rather than per candidate so a 10,000-scenario generation stays one span plus its children. With granularity scenario (the default) each accepted scenario is a credencestack generate.scenario <id> child. GeneratedScenarios (one generation per environment reset) is not traced as a generation: the episode span carries the Forge attributes.
  • Environment episodes: off by default (CredenceEnv(otel=True); env episode sets it). A credencestack episode <scenario> root span with execute_tool children for step-by-step policies; a connector policy gets an invoke_agent span under it so its framework spans nest. Reward, reward mode, seed, steps, termination reason (final, max_steps, kill_switch, connector, reset), findings as events and the final answer as credencestack.env.final (decision always, text only with content capture on public scenarios). Sampling is deterministic per episode seed: 1.0 for one environment, 0.01 for make_env_batch unless otel.sample_rate or otel_sample_rate says otherwise.
  • Root-cause fix found by the sampling test: run_batch's worker threads did not inherit context variables, so the caller's telemetry (set with otel.use) never reached them. Each rollout now runs in a copy of the caller's context.
  • Benchmarks: credencestack bench <id> (kind, name, configurations, cap, spent, episodes), a credencestack bench.config <config_id> child per configuration (agent, model, status, episodes, passed, pass rate, cost; brittleness also the fixed pass rate and the per-level rates) and each configuration's run span under it (its scenario traces stay separate and linked at granularity scenario). otel/ids.json in the benchmark (or brittleness) output maps the benchmark and each configuration to its trace and span; verification covers it. Configuration spans end at the configuration's end time but are closed with the benchmark, so the brittleness summary can be added.
  • Metrics (--otel-metrics, already a flag, now implemented): six instruments (episodes, episode duration, findings, generated scenarios, rejections, benchmark spend), attributes limited to kind, domain, result, severity, level, reason; anything else is dropped. They follow the span exporter: OTLP (same protocol), console, or <file>.metrics.jsonl beside the span file.
  • One switch everywhere: generate, env episode, env export, env serve, bench run and bench brittleness take the same four --otel* flags as run. otel print --kind run|generate|episode|bench|brittleness prints each tree offline.
  • Golden trees: tests/golden/otel/workflow-<kind>.json for run, generate, episode, bench and brittleness (scripts/gen_otel_golden.py); the normaliser now drops generation timings and replaces run ids in span names. The connector golden files are unchanged.
  • Tests: tests/unit/test_otel_workflows.py (42: goldens and tree shapes, registry consistency and coverage, the unregistered-emission check failing on purpose, Forge attributes, the canary mutator and the confidential fixture pack across generation and episodes with content on, content only when asked, episodes off by default, terminations, batch sampling, metrics cardinality, the file exporter's metrics file, the shared flags, otel print per kind).
  • Behaviour: baseline MATCH.
  • Self-check: 1221 passed, 23 skipped; ruff, mypy (strict on core), mkdocs strict and the stealth check pass. Pyright found six loose attribute types in the new test (fixed with a typed helper; 0 errors), and the docs audit read the new span name credencestack episode as a command (added to the span words it skips; 0 problems).

Phase 14. Documentation

  • Structure: Get started (install, the two-minute demo, your first real agent, reading your first report, FAQ), Guides (connectors, profiles, the domain agents, scenarios, Forge, custom mutators, brittleness, the environment, CI, telemetry with one page per platform and a page for generation, environments and benchmarks, evidence, benchmark rounds, Atryum, AP2, release checklist, troubleshooting), Concepts (how it works, with one end-to-end diagram; authority and profiles; scenarios and packs; graders and findings; statistics; evidence; generated scenarios; environments and rewards; benchmark rounds; pillars; confidential content; glossary), Reference (CLI, configuration, outputs, exit codes, findings, packs, mutators, OpenTelemetry, Python API, mappings), Benchmarks, Why, Project (open source, roadmap, changelog, governance, security, trademarks, contributing, radar) and Contributing.
  • Folded and deleted: every framework guide into its connector page (as a walk-through), the guided report tour into "reading your first report", CI gating into the CI page (duplicate sections removed), "concepts in 10 minutes" into the concepts overview, dev/data-flow.md into the architecture page. 50 pages moved with git mv; every relative link was rewritten by resolving it from the page's old location, and links inside generated snippets now depend on the depth of the page that includes them (failures_table(..., up)).
  • Vocabulary sweep: "oracle" → "grader" (about 150 occurrences) and "adapter" → "connector" in every page except the history and the pages that discuss the rename; all-adapters → all (the extra's real name since phase 7); the glossary gained benchmark, benchmark round, brittleness, difficulty, episode, generated scenario, mutator, reward and seed scenario, and lost the obsolete adapter entry.
  • Audit checks added (scripts/docs_audit.py): banned terms and old names in docs, CLI help, report templates and every string in the source (BANNED_TERMS, OLD_NAMES); every command shown on a page besides the CLI reference; every OpenTelemetry name in the docs registered (Python names, file names and the explicitly not-emitted gen_ai.system excepted); every docs page named in code exists (error hints, report footers, docs.credencestack.ai/...); mutator counts against the code; gen_tokens.py --check and the forge and otel example groups. The first run found real problems, all fixed: a docs section on credencestack.verifiable (removed in phase 4), "test case", "policy file", "schema violation" and "adapter" in source strings, a "held back" FAQ heading.
  • Bugs found while documenting (fixed at the root, with tests): credencestack generate --out was accepted and ignored (so its own help example --validate <out>/latest-generate failed); help text dropped bare <placeholders> (Writes /env-export-/), now quoted and enforced by test_placeholders_in_help_are_quoted; "a authority-style injection" in mutator descriptions; the sdist lacked bench/sample_brittleness.yaml; docs/assets/demo.tape used removed commands.
  • Generated content: gen_doc_examples.py gained a forge group (generate, explain, validate, a plugin, an environment episode, an export and one task line) and span-tree diagrams drawn from the workflow golden trees; the docs hook writes exit codes and the findings catalogue; inline Python examples on the Forge, environment and Python pages run in tests/docs/test_page_examples.py.
  • Architecture and module notes: docs/dev/architecture.md rewritten for the system as it is (components; a run, a generation, an episode and a benchmark; telemetry hooks; the evidence format; confidential content; extension points; import layering); code-walkthrough.md rewritten for the current package layout (it still described authority/, faults/, control/, metrics/, verifiable/ and telemetry/). A contributor guide names the check behind each rule. The coherence audit has no open item left.
  • Branding: scripts/gen_tokens.py generates docs/assets/stylesheets/tokens.css from reports/tokens.json (the website's tokens.css comes from it in phase 15). The theme loads no external font (font: false); Inter is self-hosted from the copy shipped inside an installed dependency (variable, Latin subset, SIL OFL, licence beside it). Fallback: Space Grotesk and JetBrains Mono are not available anywhere in the project environment and downloads are not allowed, so headings use the token's system fallback stack and code uses the system monospace stack. Mermaid stays on its pinned unpkg URL, the site's only external request: self-hosting the local copy (11.17.2, MIT) was tried, but the stealth check's substring match fires on identifiers inside the minified code, and adding third-party tokens to the private allowlist would weaken the check (conservative fallback; the docs rule bans external fonts and analytics, not this). Shield logo and favicon, a header link and a nav entry back to the website, the footer disclaimer, no generator notice. NOTICE lists the bundled font.
  • Versioning: mike is not installed and cannot be downloaded, so the site is not versioned; logged here and in the release process.
  • README, why/ and the one-pager: README and docs/why/ now open with the website's positioning line and the same commands, with short sections on packs (counts checked by the audit), connectors, Forge and the environment, telemetry and evidence. The business one-pager lives outside the repository in the private folder; it was not edited (deferred: private, outside the repository).
  • Launch article: docs/blog/drafts/your-agent-passed-the-test.md (excluded from the site build), every number a {{placeholder}}. The hook pair is real: PAY-002 (an invoice just under the limit) and G-PAYMENTS-21-0000 (adv.injection.plant, seed 21, level 2: an authority-style injection in the vendor name). scripts/fill_article.py fills it from a brittleness directory (the most and least brittle configurations, the worst level and its gap with Newcombe's interval, the mutators and family that hurt most, over-caution) and inserts the chart paths; on scripted-only runs it adds "SAMPLE DATA, NOT FOR PUBLICATION". Tested on the sample in test_fill_article_on_the_sample.
  • Behaviour: baseline MATCH.
  • Self-check: the full suite ran 1255 passed, 23 skipped, 2 failed: the committed scenario JSON Schema was stale after a docstring wording fix ("test case" → "test"); regenerated, and the affected files rerun (318 passed, 11 skipped). Ruff, mypy (strict on core), pyright (0 errors after typing a test helper), the full docs audit (163 files, 0 problems), mkdocs strict and the stealth check pass (after reverting the vendored Mermaid, above).

Phase 15. The website

  • Facts file: scripts/gen_website_facts.py writes docs/dev/website-facts.json from the code: the positioning line and paragraph (from the docs landing page and the README), the version, the seven packs (scenario counts, most targeted findings, docs links), connectors and their extras, OTel platforms with guide links, mutator counts by domain and family, the difficulty dial, the per-pack counts of generate --pack all --n 2000 --seed 42, the hook pair (PAY-002 and G-PAYMENTS-21-0000, with its --explain command, checked to reproduce the same id from the CLI), the commands the site shows, the environment API names, the Action step from examples/ci/credencestack.yml, every docs URL the site links to (the script fails if a page is missing), and the whole CLI tree with each command's flags. The measured generation rate (about 20,000 scenarios a minute on the machine that wrote it) sits in a measured block that --check ignores, so the file is deterministic.
  • Bug found in the docs audit while building the facts: Typer's group class here is not a click.Group subclass, so check_cli never descended into subcommands or validated a single flag, and the new "every command documented" check passed vacuously. Both now detect groups by their commands mapping; the audit then found two commands shown on no page (packs show, profiles import), now documented. Every flag written in the docs checks out.
  • Fallback: Astro is not installable here. No Astro package exists anywhere on this machine (no project copy, no npm cache) and downloads are not allowed. The site is written as a complete Astro project (package.json with pinned versions, astro.config. mjs, a base layout, components and the eight pages) but has not been built, type-checked or screenshotted; npm install && npm run check must run where packages can be installed. Logged as the main open item for the maintainers. What was verified offline: the facts file and its --check; scripts/check_facts.mjs (Node standard library only) against the page sources, including a deliberately wrong page that it rejected on five counts (an unknown flag, a stale flag, a wrong mutator count, a wrong level range, a wrong CredenceEnv keyword); node --check on every script; the Open Graph image and icons; the stealth check over website/.
  • Pages: / and /forge follow the approved designs as Astro components (not embedded HTML), with the spec's changes: real commands and API names from the facts (the design's --adapter, demo --all-packs and CredenceEnv(generator=...) do not exist); the hook card uses the real pair; the brittleness curve is a shape only, labelled "Illustrative · results at launch" with a hidden table of [TBD]; the Forge terminal shows the real per-pack counts and the real rejection count; the dial table and the mutator cards come from the facts; "Open / Held back" became "Everything is open" and "Fair benchmark rounds". /packs, /integrations, /sample-report (copied from docs/sample-report/ at build time, with a placeholder when missing), /benchmark (method, four chart slots, rounds, reproduction; every number [TBD]), /security (from SECURITY.md) and /404.
  • Shared design: scripts/gen_tokens.py now also writes website/src/styles/tokens.css from reports/tokens.json (one source for reports, docs and site; the token pairs are WCAG AA by the existing test and again in check_site.mjs). Inter is self-hosted with its licence; Space Grotesk and JetBrains Mono fall back to system stacks (not available locally, as in phase 14).
  • Accessibility and behaviour as written: landmarks, one h1 per page, a skip link, visible focus, 44 px targets, labelled icon buttons, decorative SVGs aria-hidden, prefers-reduced-motion; JavaScript only for the copy buttons (with an aria-live "Copied") and the menu, which is a <details> element that works without it.
  • SEO and privacy: titles, descriptions, canonical URLs, Open Graph and Twitter tags, a 1200×630 image and PNG icons drawn with matplotlib without metadata (website/scripts/make_images.py), robots.txt, site.webmanifest, JSON-LD SoftwareApplication (Apache-2.0, repository, price 0, publisher "CredenceStack contributors"), CNAME. No external request, analytics or generator tag; check_site.mjs checks the built HTML for these, for broken internal links, unlisted external links and placeholders, and greps dist/ for denylisted terms when the private denylist is present.
  • Checks and CI: npm run check runs astro check, the build, the facts check and the site check. Not available offline and logged as skipped: an HTML validator, axe-core or pa11y, Lighthouse CI, and the 1440 and 390 px screenshots (they need the build). .github/workflows/website.yml runs npm run check on changes under website/, with a disabled GitHub Pages deploy job.
  • Hand-off: website/README.md (run, build, check, facts, placeholders, deployment to GitHub Pages with the custom domain as numbered steps; the DNS addresses are marked TODO-verify), website/PLACEHOLDERS.md (twelve placeholders and what fills each), website/EXTERNAL_LINKS.md.
  • Not committed: website/ stays untracked, as for every commit of this build; the facts generator, the facts file, the token generator, the workflow and the docs changes are committed.
  • Charts for approval: no real, non-sample chart file exists in the repository; nothing was published.
  • Behaviour: baseline MATCH.
  • Self-check: this phase changes scripts, CI configuration and the uncommitted site, not the package, so the package suite was not rerun; the reference and structure tests pass (11), as do ruff, mypy (strict on core), pyright (0 errors), the docs audit, mkdocs strict, the stealth check (which scans website/ too), gen_website_facts.py --check, gen_tokens.py --check and check_facts.mjs on the sources. npm run check was not run (no Astro available).

Phase 16. End-to-end proof, review and release check

  • Golden path (tests/e2e/test_golden_path.py, about a minute): config init, doctor, demo, generate (payments and kyc, seed 7, 40 scenarios, validated), run on the generated packs with telemetry, report, evidence verify, a redacted export (verified), env episode with a connector policy and telemetry, env export, the offline brittleness sample and fill_article.py, each as its own process. It checks exit codes, every manifest against the schema, the console header and closing block, the report's sections, one connected trace per traced command (with --otel-granularity run where a command spans several scenarios), and that confidential content (the canary pack and the canary mutator, with content capture on) reaches no redacted export, trace or manifest. A third test checks that every pack and mutator is exercised: applied in a 2,000-scenario generation, or named by a test (pay.batch.hidden_item applies only to batch seeds at levels 4-5 and had no test; one was added, and the safe agent passes its scenarios).
  • What the golden path found, fixed at the root: evidence export and report printed no header line (P2-8); report's help claimed brittleness outputs it refuses; the generate manifest recorded the requested --mutators ids in clear, so a confidential mutator's id reached it (now confidential:<hash>, with a regression test).
  • Confidential ids, a deferred decision: the golden path also showed that bundles, and so their redacted exports, keep a confidential scenario's id and pack (with a generic description and no content). That is the boundary evidence/privacy.py documents and the phase 5 and 6 decisions rely on (the export keeps the run's own signature, so its files are the run's files), but P2-6 claimed hashed ids. P2-6 and the concepts page now describe the implemented boundary; hashing scenario ids inside bundles is deferred (coherence audit, "Phase 16 additions") because it changes the bundle format and every reader. Content canaries are checked everywhere; ids are checked in traces.
  • New goldens (scripts/gen_goldens.py, tests/unit/test_goldens.py): every command's help (41 commands and groups), the manifest of each output kind (run, generate, env-export, export, bench, brittleness) and the report data models of a run and a brittleness benchmark, with volatile values normalised (ids, hashes, times, durations, byte counts, Inspect log names, versions, the environment block). Stable across runs. The workflow span goldens now ignore the version attribute.
  • Behaviour baseline: compared one last time: MATCH. Then tests/golden/behaviour-baseline.json and scripts/behaviour_baseline.py were deleted.
  • Bench and brittleness charts: matplotlib warned when a legend had nothing to label; reports.charts.legend now draws one only when something is labelled, and every chart uses it (tests run clean with warnings as errors).
  • Leftovers sweep (oracle, adapter, heldout, held-back, premium, private:, include_private, rotate, legacy, deprecated, compat, old_, TODO: remove, old flags, old schema versions, zip bundles). Fixed: a .gitignore comment about held-back packs, an inventory entry naming a private file about the old content model, heldout and private in two tests, "legacy" for OpenTelemetry's older attribute. Justified and kept: the banned-word lists themselves (docs_audit.py, cli/grammar.py's BANNED_FLAGS, the contributor guide, the style guide, the design principles and the coherence audit, which record the renames); the sample report's download archives (<agent>-bundle.zip, phase 5's reproducible archives of signed bundles, not an output format); the history. The old-name list in docs_audit.py gained the removed flags, include_private, credencestack.evidence/v0, credencestack.verifiable, credencestack.telemetry, legacy, deprecated and "TODO: remove".
  • Fresh-eyes read-through (README, Get started, the Forge guide): the install page was titled "Setup" under the nav's "Install", did not say Python 3.12, and lacked the judge and tenuo extras; the demo page was titled "Quickstart", repeated the extras table and never ran credencestack demo. Both rewritten: the demo page now leads with credencestack demo and points onwards to the first agent, the report and Forge. The Forge guide's commands ran as written.
  • Release check (scripts/release_check.sh) gained: Forge determinism across two processes (200 scenarios from every pack, byte-identical), the generate --validate round trip, the environment tests, the offline brittleness sample (run and verified), the golden path, manifest schema validation, telemetry registry coverage and privacy, the goldens, the span trees, the website facts and the design tokens.
  • Version and changelog: 1.0.0rc4 (the next free rc; uv lock --offline updated the lock), and CHANGELOG.md rewritten as one 1.0.0 entry describing the product as it is. release_version.py --tag v1.0.0-rc4 agrees.
  • Build summary: docs/dev/build-summary-v1.md. The private reference (internal/credencestack-reference.md, never committed) gained section 3.28 and an updated status.
  • A flaw in this build's own self-checks, found by the release check: every phase's self-check ran mkdocs build --strict -q. With -q, MkDocs logs only errors, so the strict warning counter never saw a warning: those "mkdocs strict passes" lines were not strict builds. The release check builds without -q and found 20 warnings: links in a generated snippet included at a different page depth (the code walk-through, now a link to the guide), links to episode anchors that the report tour's extract cuts away (now unlinked by report_extract), and CONTRIBUTING.md's relative link to the code of conduct, which breaks when the docs include it (now an absolute link). The strict build now passes with no warnings, checked without -q.
  • Also fixed: the CLI-help golden rendered help in-process, where other CLI tests change the console state; each help is now rendered in its own process. Two tests were pinned to removed wording (the changelog's first words, the extras table that moved to the install page) and now read the new pages.
  • The fixture-exclusion check reused a stale build: the release check grepped an existing site/ (from an earlier build) when one was present, and the build log named the canary word when describing the fixtures. The check now builds the docs fresh into its own directory, and the log says "canary strings". A fresh strict build contains no fixture content.
  • Behaviour: baseline MATCH (final comparison), then removed.
  • Self-check: 1,266 passed, 23 skipped (91% coverage); ruff, mypy (strict on core), pyright (0 errors), the docs audit (164 files, 0 problems), MkDocs strict without -q (0 warnings), the stealth check, and scripts/release_check.sh --skip-extras: PASS (v1.0.0rc4; the Docker Collector test skipped, no Docker here). Not run: the per-connector install checks (they download extras), the website's npm run check.

Test your agent as it is (credencestack test)

Asked for after v1.0.0-rc4: test any agent (any common framework, or written from scratch, or deployed as a service) with no changes to its code, with defaults chosen from what the agent does, fixed and generated scenarios, a comprehensive report with improvement suggestions, and set-up problems never shown as findings. All of P0, P1 and P2 of the product plan, in one build.

  • Interception, not replacement: the framework connectors replace the agent's tools with CredenceStack's; credencestack test keeps the agent's own tools and replaces only their functions, once and in place, by proxies that call the original outside an episode and the episode's environment inside one (a contextvars variable, copied into the threads and tasks frameworks run tools in). Prompt, model and middleware are untouched. Drivers for LangGraph, the OpenAI Agents SDK, ADK, Strands, MSAF, the Claude Agent SDK (module-level @tool objects), CrewAI and plain functions (TOOLS list or dict, or OpenAI/Anthropic-style schemas). CrewAI is not installed here: its driver is written to the same pattern and untested (logged as such); every other driver is tested with an agent built in the framework's own way.
  • Tool map: deterministic concept matching on names, descriptions and arguments, with a read-verb guard (a get_ tool never maps onto an acting tool), minor-unit amounts, arguments taken from the task, and result aliases. Ties go to the more specific rule (approve_application is approve_onboarding, not request_senior_approval). Below 0.55 confidence a tool stays unmapped and answers "not available".
  • Decision: inferred (stated JSON, then halt, payment, approval, then words). The agent's prompt gets no format instruction, unlike the connectors'.
  • Applicability: a scenario runs only if its must-call, fault, injection and kill-switch tools are served and a deciding tool is mapped; kill-switch scenarios only when the agent is stoppable (Strands natively, others through stop = "module:function"). Everything else is "not tested", never failed.
  • Set-up never a finding: blocking checks and a smoke episode before anything is graded; every episode labelled behaviour, set-up or infrastructure; infrastructure failures retried before any tool call; non-behaviour episodes left out of every rate; over 10% of them and the report shows set-up notes and no findings. Any agent exception is set-up, deliberately conservative (the user's requirement); it stays visible in the set-up notes and in the evidence bundle.
  • Your own profile: --profile relabels each scenario with Forge's labeller; a scenario it cannot relabel is kept only when every invoice amount is on the same side of every limit in both profiles, else not tested. Without this, a correct payment under the user's higher limit would be graded against the example profile's expectation. credencestack profiles init writes the profile from eight questions.
  • Assessment: a new output kind, test (manifest section test), holding the ordinary fixed/ and forge/ run bundles, assessment.json and the report. Findings are grouped into ten categories from assess/remediation.yaml, each with a fix in the systems, one per framework (only features the repository's example agents already use and test), and the prompt change; ranked by severity × episodes × fragility. Outcome-only failures get pseudo types (acted_without_approval, did_not_complete...).
  • Backend mode: REST from an OpenAPI document (stdlib threaded server) or MCP tools (the MCP SDK server, Streamable HTTP); the agent's chat endpoint in OpenAI or one-field JSON form; optional start and stop of the service. Episodes run one at a time.
  • Examples: examples/test_your_agent/: the same accounts-payable clerk from scratch, with LangGraph, with the OpenAI Agents SDK and as an HTTP service, with offline stand-in models. All four give the same assessment (72% fixed), which checks the drivers against each other.
  • Docs and site: "Test your agent in five minutes" (framework tabs, a deployed service, checks, the agent file, your own rules, modes, CI), what gets tested by function, how it works, the agent-file reference, a tip on every connector guide, README, home page, changelog, glossary; generated examples (scripts/gen_doc_examples.py --only test). The website's home page leads with credencestack test and a chooser from the facts file.
  • Fixed on the way: the help examples must run offline, so they use the example agents; dataclass field named field shadowed dataclasses.field (renamed request_field); YAML plain scalars with colons in the catalogue (quoted).