FrankenMining

Adit: surfaces and the agent model

1,432 words6 subsections4 tables1 listingPlan version 0.1

On this page6
30.1 The robot envelope and exit codes30.2 The verb registry, CLI, doctor and repair30.3 Daemon, MCP and TUI30.4 The agent model: agents prepare, humans authorize, and everyone is scored30.5 Rendering and reports30.6 Proof obligations and gates

30.1 The robot envelope and exit codes

Envelope (FMT-ENV-1). --json emits one event per line:

{"v":1,"event":"<schema-id>","node":"<node_id>","anchor":{"<cell>":<seq>},
 "data":{},"certificate":"<digest or null>",
 "flags":{"reserve_disclosure_claim":false,"execution_authorized":false,
          "geotechnical_signoff":false,"regulatory_compliance_claim":false},
 "warnings":[],"next_actions":[{"command":"…","why":"…"}]}
  • The four flags are always false. The envelope type has no setter for them (INV-002), and a golden test checks every schema.
  • Every number in data is a serialized Claim or a reference to one. There are no naked numbers (§8).
  • next_actions tells an agent or operator exactly what to run next, with the reason.
  • serde is permitted in this format only.

Exit codes are a superset of fa/fgdb:

Code Meaning
0 OK
2 Usage error
3 Domain-law refusal (conservation, QA/QC, basis, support)
4 Environment or degraded mode (e.g. a read-only node after writer escalation)
5 Foundation I/O error
6 Conflict: lease, fencing, stale anchor, idempotency
7 Safety or authorization: MNPI wall, venture wall, residency, missing human token
8 Verification failure (certificate, proof, digest)
9 Indeterminate. An effect or post may have happened. Reconcile by key; never retry blindly.

1 is never emitted, so a generic crash can never be mistaken for a typed outcome.

Refusal family → exit code (R7-C092, R7-C100). 1xx domain law → 3; 2xx evidence (insufficient, conflicted, stale, uncalibrated) → 3; 3xx authorization and walls → 7; 4xx safety-semantic → 7; 5xx anchor and artifact integrity → 8 for a digest or signature mismatch and 6 for a stale anchor. Usage errors (unknown issuer, malformed id) are exit 2 with no refusal code. A missing or unreadable registered input is a typed refusal that names the file, never a digest-mismatch code. registries/refusals.toml is the single source: the compiled catalogue is generated from it, and a CI check compares code, meaning and exit code in both directions with §8.4, §25.6 and §31.3.

30.2 The verb registry, CLI, doctor and repair

  • One registry, many projections. registries/verbs.toml defines every verb:

    • name, cluster and kind (read, prepare, admin);
    • required capabilities and walls;
    • input and output schema ids;
    • possible refusals and exit codes;
    • idempotency key rule;
    • examples.

    The CLI, MCP and TUI are generated from it, and none of them has a verb the registry lacks.

  • Bare fmine prints triage: live obligations, stale cells, open refusals, gates near threshold, budgets near their limits.

  • Representative verbs:

Verb Kind What it does
fmine claim show <id> / why <id> / trace <id> read Show a Claim; explain its value (evidence, colour, UU term); walk its provenance DAG
fmine assure public --issuer <ticker> read The M0 public lane: reproduce published metrics from filings with certificates (§21.6, §37)
fmine forecast register / score prepare Freeze and hash a forecast before resolution; score it after (§10)
fmine recon run / close prepare Run the reconciliation posterior; prepare a period close for attestation (§20)
fmine plan certify <plan> read Produce the three-gap PlanCertificate (§15.2)
fmine post prepare / status prepare Prepare a posting slot; show slot states (§21.3)
fmine decide card <decision> prepare Draft a DecisionCard with VOI and flip margins (§22)
fmine reserve pack <estimate> prepare Assemble the CP/QP support pack and data-verification index (§24)
fmine verify <bundle> read Offline verification of certificates, bundles and MMR proofs (also as fmine-verify)
fmine report <kind> read Render a report with anchor, certificate and no_claim line
fmine robot-docs / robot schema <id> read Machine-readable documentation and JSON Schemas for agents
fmine doctor read Hash chains, high-water marks, pins, budgets, obligations, the Little audit, residency and wall configuration
fmine repair plan / repair apply <digest> admin plan emits a digest-addressed repair plan. apply executes exactly that plan and nothing else, so nothing can drift between review and execution.

30.3 Daemon, MCP and TUI

  • fmined, one per node, holds the cell leases and serves <node>/fmined.sock. Its supervisor tree is the role's AppSpec (§26.7). The CLI talks to it when present. Without it, the CLI runs read-only against projections and says so.
  • fmine-mcp projects the verb registry as MCP tools.
    • Tools come in clusters of at most 7, each cluster a task (for example reconciliation, forecasts, reserves pack), so an agent's tool list stays legible.
    • It is read-mostly. Effects are prepare_* only.
    • A parity gate (INT-FMCP-001) diffs tool schemas and refusals against the registry in CI.
  • fmine-tui is an ops console in frankentui inline mode. It shows sync lag per cell, ingest ρ, obligation queues, posting slots and refusals. It adds no authority path.

30.4 The agent model: agents prepare, humans authorize, and everyone is scored

AI agents (internal, Avathon's, or a third party's) are first-class principals, not a back door.

Rule Mechanism
Agents read the cognition plane and cite Claims Caveated tokens: agent id, scope, walls, ventures, residency
Agents never write authority Agent outputs enter CELL-QUAR as evidence class AgentUpload, REVIEW_REQUIRED. They become authority only when a human with the role adopts them.
Agents never upgrade evidence The no-laundering rules apply to agents as to engines (§7.3)
Agents may prepare effects and DecisionCard drafts prepare_* verbs only. Release needs a HumanAuthorityToken (§31.3), which agents cannot mint.
Agent forecasts are registered and scored An agent's forecasts enter the calibration ledger with the agent as author (§10). Calibration is reported per agent, and trust (for example, triage ordering) is earned by track record.
Walls apply to agents unchanged MNPI and venture walls bind agent sessions. Every agent read is an AccessEvent and appears in insider-list logs (§31.1).
Imported text is data, not instructions Documents, filings and vendor exports pass quarantine-on-import. Text in them never becomes a command. Agent-proposed effects cite the Claims they rely on, and the release card shows them.

Agent ergonomics. Typed refusals with a fix hint, next_actions, stable schema ids, idempotent prepare verbs with keys, and robot-docs that a fresh agent can learn from. GATE-ROBOT-01 tests this directly.

30.5 Rendering and reports

  • Claims render through franken_evidence::render::{level1, markdown, html} plus FrankenMining rows: the evidence class badge, KK/KU/UU, the flip margin and the calibration flag.
  • Reports render through franken_markdown (HTML/PDF), with diagrams from frankenmermaid (default features): flow graphs, claim DAGs, plan Gantt charts.
  • Every report carries its anchor, its certificate digest and a no_claim line, for example: "This report makes no reserve disclosure claim, no execution authorization, no geotechnical sign-off and no regulatory compliance claim."
  • Reports are deterministic by digest (INT-FMD-001): the same anchor and inputs give the same bytes.
  • Language rules:
    • ranges, not points;
    • evidence class next to every number;
    • "evidence state", never "safe" (§18.1);
    • colour-blind-safe palettes;
    • every number clickable to its Claim;
    • plain sentences on executive pages: each §9.6 field written out in words (for example "inside its 80% range in 15 of 20 quarters", "the conclusion reverses if gold falls below $2,900/oz"), with the coded map kept as the analyst view.
  • The executive one-pager is the epistemic map (§9.6). The K5-style test (KILL-PLUMB-5) shows its plain-sentence rendering first and the coded layout second; if users fail both, it falls back to a three-field card: range, evidence class, flip margin.

30.6 Proof obligations and gates

PO / Gate Statement Verification / threshold
PO-ADIT-1 The four flags are false in every envelope of every schema Golden test over all schema ids (INV-002)
PO-ADIT-2 CLI, MCP and TUI expose exactly the registry's verbs, with identical schemas and refusals Parity diff in CI
PO-ADIT-3 repair apply <digest> executes exactly the plan with that digest Lab test with plan tampering
PO-ADIT-4 No exit code 1 is emitted on any path Fuzzed CLI invocations
GATE-ROBOT-01 A fresh agent, given only fmine robot-docs, completes 20 scripted tasks (≥ 18 correct, 0 authority writes, 0 wall breaches) M1
GATE-REPORT-01 A board-pack report regenerates byte-identically from its anchor M3