Skip to content

feat(engine): deliver every selected standard to application agents, labelled - #9

Merged
MrScripty merged 4 commits into
mainfrom
feat/application-labelled-delivery
Nov 12, 2026
Merged

MrScripty merged 4 commits into
mainfrom
feat/application-labelled-delivery

Conversation

@MrScripty

Copy link
Copy Markdown
Owner

Summary

Application approval was a gate: one module without a current approval anywhere in a selection rejected the whole route with "awaiting application publication", naming nothing. 40 of 85 registered materials are not currently approved, including two of three application profiles, and any edit to Core or the Router would have taken every application call offline until re-approval. In recorded use, 43 of 91 application routes were rejected this way, and agents responded by deleting true facts from their queries.

Approval is now a label, not a gate. This is interface 49.

  • Labelled delivery. Every registered material a call selects or names is delivered. Each read result and each reading-plan entry carries review_state: current, changed-since-review or not-reviewed. The approval manifest and the authoring-side exposure workflow are unchanged.
  • Clear rejections. An unregistered or misspelt identity is APPLICATION.UNKNOWN_TARGET. A traversal a relationship group does not permit is APPLICATION.TRAVERSAL_NOT_PERMITTED. APPLICATION.CONTENT_UNAVAILABLE is removed.
  • Client-sized pages. Application route content pages hold about 40 KiB of structured result by default (--route-page-bytes, 8 KiB to 2 MiB) and always at least one whole module. The previous 2 MiB bound produced pages the client diverted to a file. Authoring paging is unchanged.
  • Usage guidance. The application connection instructions and tool descriptions are rewritten in plain language. A new application skill, .agents/skills/coding-standards/SKILL.md, teaches the same sequence with a worked example taken from real engine output.

Wording to review

  • The application initialize instructions: APPLICATION_INSTRUCTIONS in tools/standards_engine/standards_engine/mcp.py.
  • The application tool descriptions: APPLICATION_DESCRIPTIONS in tools/standards_engine/standards_engine/mcp_catalog.py.
  • The skill file. One sentence in it is advice rather than a restatement of the standards: to tell the user when two modules seem to disagree instead of silently choosing.

Things to know

  • Servers need a restart and clients a catalog refresh after this lands. The result projection version moves from 8 to 9.
  • Application agents can now read every registered material. That includes seven documentation artifacts and workflow.standards-authoring, all labelled not-reviewed. Decision provenance and unregistered consumers stay out.
  • The skill only takes effect once it is linked into the client skill folders.
  • docs/guides/positive-guidance-and-provenance.md still describes the gate. It is pinned by a coverage certificate and is left for a certificate retirement.
  • The generated contract and tool catalog are regenerated by the repository generator, which accounts for most of the diff size.
  • The CI path filter gains the new skill folder.

Verification

  • A real server process on this change: a route with implementation, library and rust, which is rejected on main, returns its five modules with labels (profile.application.library as not-reviewed) in a first page of 35 KB with a continuation. A misspelt target returns APPLICATION.UNKNOWN_TARGET.
  • The full CI sequence was not run on this exact tree. It passed locally on the tree of the next pull request in the stack, which adds only a small recorder change: 666 engine tests, the twelve other suites, structural verifier 73/73. That run did not include the one-line CI path-filter change.
  • 13 new engine tests cover labels on routes, pages, read_many and scoped reads; Core and Router with lapsed approval; the new rejection codes; the page budget; and consistency between preview and published application.

Stack

Fourth of five. This branch contains the commits from #6, #7 and #8; review the last commit.

🤖 Generated with Claude Code

MrScripty and others added 4 commits November 12, 2026 07:20
…iliation

Six engine tests have failed on main since 22 October, when two changes
landed without the tests that depend on them being updated:

- Interface 48 (ad56443). Four publication tests asserted the literal
  "interface 47;" in the server instructions, and two contract examples
  still carried interface_version 47. The assertion now reads the number
  from the interface the server under test serves, so it cannot go stale
  again, and the examples say 48.
- Publication checkout reconciliation (8c5a4ad). The create-and-retire
  apply test still asserted that apply leaves the working tree untouched.
  It now asserts the documented behaviour: HEAD, index and worktree present
  the published candidate and no other local difference exists.

No production code changes. The suite-input manifest is regenerated; it was
already stale on main because 5bce311 added files without refreshing it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The MCP server opens the snapshot store for each tool call, and every open
of an existing store ran PRAGMA integrity_check and foreign_key_check over
the whole file. On a 282 MB store that is about 0.6 s added to every
route, read and related call, growing with the file.

The full audit now runs at most once per process for each store file,
identified by device and inode. It still runs on the first open in every
process, throughout a version 1 migration, and for a file put in place
under a different inode. Application id, schema version and exact schema
checks still run on every open. Measured on a copy of that store, five
consecutive opens in one process go from about 0.6 s each to 0.6 s for the
first and under 1 ms for the rest.

Known limits, documented in the snapshots README: a one-shot CLI call is a
new process and still audits; a store deleted and recreated in place can
reuse its inode on ext4 and is then not audited again by a server that is
already running.

Tests cover one audit for two opens, a replaced file, a corrupt
replacement, the checks that stay on every open, a fresh process rejecting
a corrupted file, migration keeping all of its audits, and the server
auditing once across several tool calls.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The recorder exists to show how agents use the tool interface so the
interface can be improved. As built it could not do that: it was off
unless two flags were passed, so the application purpose was never
recorded; it gave up for the life of the process after a 20 ms lock wait,
so servers started together recorded nothing; and it stored argument
shapes rather than values, so it could not say which standard was read,
which facts were sent or which rejection came back.

Always on. Every server process records to
${XDG_DATA_HOME:-~/.local/share}/standards-engine/observations/
interactions-v2.sqlite3 with no flags. --no-observe or
STANDARDS_ENGINE_OBSERVE=off turns it off. In-process MCPServer
construction records only when given a configuration, and every test and
harness launch passes --no-observe; a guard test fails if a new launch
site forgets.

Invisible. Tool results are unchanged, a healthy recorder writes nothing
to stderr, and a recording failure never changes or fails a call.

No dropped records. A busy database queues the row in a bounded in-memory
backlog and delivers it at the next call or at close. The database uses
write-ahead mode. Eight processes started at the same instant on a new
database now keep all 176 starts and terminals; the previous code kept 42.
Loss that does occur (backlog overflow) is counted in the database.

Seven-day window. Unchanged. A full file now evicts its oldest records
instead of refusing new ones. Schema v2 uses a new file; a v1 file is
refused and left untouched.

Useful values. Navigation calls keep targets, options and route facts as
sent, bounded to 200 characters per string. Authoring calls keep only
identifiers and enum words, never bodies, titles, rationales or evidence.
Results keep kind, status, code and the selected or returned module IDs.
A client thread id is stored only as a keyed hash, with a main or
subagent marker. No other request metadata is read.

The report gains a readable text summary (rejection rates, latency and
size percentiles, refused fact names and values, most-read targets,
repeat reads per thread) and a --since-days filter.

MCP-OBSERVABILITY.md is rewritten for the new contract.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…labelled

Application approval was a gate: one module without a current approval
anywhere in a selection rejected the whole route with "awaiting
application publication", naming nothing. 40 of 85 registered materials
are not currently approved, including two of three application profiles,
and any edit to Core or the Router would have taken every application call
offline until re-approval. In recorded use, 43 of 91 application routes
were rejected this way and agents responded by deleting true facts from
their queries.

Approval is now a label. This is interface 49.

- Every registered material a call selects or names is delivered. Each
  read result and each reading-plan entry carries review_state: current,
  changed-since-review or not-reviewed. The approval manifest and the
  authoring-side exposure workflow are unchanged.
- An unregistered or misspelt identity is rejected as
  APPLICATION.UNKNOWN_TARGET, and a traversal a relationship group does
  not permit as APPLICATION.TRAVERSAL_NOT_PERMITTED.
  APPLICATION.CONTENT_UNAVAILABLE is removed.
- Application route content pages are sized for inline display: about
  40 KiB of structured result by default (--route-page-bytes, 8 KiB to
  2 MiB), always at least one whole module. The previous 2 MiB bound
  produced pages the client diverted to a file. Authoring paging is
  unchanged.
- The application connection instructions and tool descriptions are
  rewritten in plain language: what the server is for, the sequence of
  calls, snapshot reuse and what the labels mean. A new application skill,
  .agents/skills/coding-standards/SKILL.md, teaches the same sequence with
  a worked example taken from real engine output.
- Tests that hard-coded the interface number now read it from the
  installed interface.

The generated contract and tool catalog are regenerated by the repository
generator. The CI path filter gains the new skill folder.

One current guide, docs/guides/positive-guidance-and-provenance.md, still
describes the gate. It is pinned by a coverage certificate and is left for
a certificate retirement.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 12, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 554319d6-df7e-4e2c-8174-e87b66bbadf9
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@MrScripty
MrScripty merged commit 7b7c6df into main Nov 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant