Skip to content

Commit ebf2fda

Browse files
committed
feat(engine): improve agent interface efficiency
1 parent 34c2dcb commit ebf2fda

34 files changed

Lines changed: 4262 additions & 131 deletions

‎.agents/skills/standards-engine/SKILL.md‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ Tool-name prefixes vary by client; operation names match the Engine contract
2222
(for example, `route`, `read`, and `propose`).
2323

2424
Use `routing_facts` when the registered fact vocabulary is unknown. Use
25-
`route` with explicit engineering facts, then `read_many` for the selected
26-
exact policies in one call. Use `read` for one item and `related` for relationships.
25+
`route` with explicit engineering facts and `content: {}` to receive selected
26+
exact policies immediately. Follow `content.next` when more remain. Use `read_many`
27+
for an explicit subset, `read` for one item, and `related` for relationships.
2728
Omit `snapshot` on the first call to capture
2829
accepted authority; reuse the returned snapshot on subsequent calls. Omission
2930
always captures a new snapshot, so carry the handle when continuing a task.
@@ -87,6 +88,12 @@ accepted-snapshot Analysis, verification preflight, and evidence maintenance
8788
remain available through the explicit advanced catalog; see
8889
[references/environment.md](references/environment.md).
8990

91+
Repeated exact evidence references in `propose`, `revise`, `resolve_workflow`,
92+
`resolve_many`, or `review` may use a request-local `evidence` table. Every typed
93+
`{"evidence_ref":"name"}` explicitly selects one complete reference from that
94+
same request. Normal inline references remain valid. Supply real evidence and
95+
retain each decision's own rationale and authorization; names confer neither.
96+
9097
## Choose The Workflow
9198

9299
- For routing, reading, relationship discovery, or accepted-snapshot Analysis,

‎.agents/skills/standards-engine/references/authoring.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,33 @@ a later round. `workflow_status` stays summary-only; full diagnostic results
8282
retain their native fields and omit inline work. Neither presentation choice
8383
changes review, approval, publication or recovery authority.
8484

85+
## Request-Local Evidence Reuse
86+
87+
The five focused authoring calls `propose`, `revise`, `resolve_workflow`,
88+
`resolve_many`, and `review` accept an optional top-level `evidence` map. A map
89+
entry binds a caller-selected name to one complete, real `EvidenceReference`.
90+
In a typed evidence-reference position, `{"evidence_ref":"review_record"}`
91+
selects that request's `evidence.review_record`. Inline references and local
92+
uses may be mixed. Use sharing when references repeat; a single use can be
93+
smaller inline.
94+
95+
The table supports at most 128 entries. Every entry must be explicitly used;
96+
missing names, unused entries, references inside the table, and malformed fields
97+
reject before domain dispatch. Local names cannot refer to a previous call or
98+
another agent's table. Authored text and arbitrary JSON values are not interpreted
99+
as local references.
100+
101+
Expansion produces the original native request. Each operation's native evidence
102+
uniqueness rules are checked after expansion. `resolve_many` checks its 256 KiB
103+
serialized-submissions bound after expansion too. Actual provider, digest, live
104+
bytes, exact work identity and per-decision authorization are still validated by
105+
the existing owners. Sharing bytes does not share decisions or approvals, and
106+
creates no persisted registry, new evidence or implicit acceptance.
107+
108+
Advanced native operations keep their complete-reference input contracts. The
109+
canonical examples include inline and request-local forms; the installed tool
110+
schema determines the exact supported positions.
111+
85112
## Edit Selection
86113

87114
Use the installed `propose` schema as the authority for edit variants and fields.

‎.agents/skills/standards-engine/references/environment.md‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ configured purpose.
5151

5252
The local server remains synchronous MCP stdio with protocol `2025-11-25`;
5353
requests execute serially and immutable Engine handles survive reconnection.
54-
The current implementation is 0.2.0 and Engine interface 38. No network listener,
54+
The current implementation is 0.2.0 and Engine interface 39. No network listener,
5555
paid model turn, remote publication or extra server dependency is introduced.
5656
The existing local authoring authorization adapter is owner-operated and
5757
always-allow; explicit user authorization still governs requested changes.
@@ -102,3 +102,24 @@ MCP SDK harness requires the SDK in a separate client environment and the locked
102102
Engine Python supplied through `--engine-python`. The optional Codex test uses
103103
`--server standards-authoring` (or the actual configured authoring name) and does
104104
not start a model turn. These checks do not certify the content's editorial quality.
105+
106+
## Schema presentation (interface 39)
107+
108+
`--schema-mode compatibility` is the default. It retains inline input schemas and
109+
schema text for the established nested-rendering workaround. Hosts with verified
110+
support for local JSON Schema references may explicitly select `--schema-mode native`.
111+
Native mode omits the duplicate description text and chooses the smaller complete
112+
inline/reference input projection per tool. It is a lossless catalog presentation;
113+
validation, output schemas, purpose, permissions and domain behavior are unchanged.
114+
115+
Select the mode in host configuration, then restart/reconnect. There is no guessed
116+
client-name policy, automatic downgrade, or transport-session state. The existing
117+
catalog digest reflects the actual tool definitions (identical projections share
118+
a digest even across mode names); use `runtime_info` to detect a
119+
stale client catalog. Preserve all stores, proposals, readiness and recovery handles.
120+
121+
Qualify the actual configured client before choosing native mode. The optional
122+
`codex_navigation_client.py --schema-mode native` checks the already configured
123+
registration; it does not reconfigure Codex or start a model turn. Passing schema
124+
validation alone does not establish successful model-visible rendering. Retain
125+
compatibility mode while that client qualification is unavailable.

‎.agents/skills/standards-engine/references/navigation.md‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ MCP tool definitions supplied by the client; invoke the tools directly.
1313
3. `route` selects applicable standards and required closure from explicit facts;
1414
`read` returns exact policy by canonical ID; `related` traverses explicitly
1515
selected permitted relationship groups and directions.
16-
4. After routing, group the selected policies into `read_many` with the returned
16+
4. Request `content: {}` on `route` to receive the selected exact policies directly
17+
(see the bounded-content contract below). For an explicit subset instead,
18+
group the selected policies into `read_many` with the returned
1719
snapshot and ordered `items` such as `[{"target":"core"}]`. Select up to 32
1820
unique read items per call. The complete result is bounded to 2 MiB and any
1921
unavailable item rejects the whole group; narrow the selection on a limit.
@@ -35,6 +37,29 @@ Use `find_snapshots` to resume a known lifecycle. Delete or undelete a snapshot
3537
only when the user requested that lifecycle change; deletion does not authorize
3638
standards mutation.
3739

40+
## Bounded Content With Routing
41+
42+
Focused `route` accepts optional `content: {"limit": 8, "offset": 0}` in both
43+
purposes. Omission preserves selection-only behavior; `{}` requests the first
44+
page with defaults. A page contains up to 32 exact compact reads in the route's
45+
selected, deduplicated target order. `content.total` counts all selected targets;
46+
`content.offset` identifies this page. Follow `content.next` as the entire next
47+
`route` request, preserving its facts and snapshot. Nonzero offsets require an
48+
explicit snapshot. Changing facts intentionally starts a different selection.
49+
50+
The complete route result, including its plan, questions, items and continuation,
51+
is limited to 2 MiB. Byte pressure returns fewer whole reads. A first record that
52+
cannot fit returns a typed limit rejection, never clipped policy text. Request a
53+
selection-only route and explicitly `read` that target when the client can receive
54+
it. An unavailable selected dependency or a failed read rejects the result;
55+
partial prefixes are not returned as success. An offset equal to the selected
56+
count returns an empty final page; a larger offset is invalid.
57+
58+
All content uses the same captured authority and ordinary read/qualification
59+
rules. Missing facts remain unresolved even when selected text is returned.
60+
Only the selected content is paged; the reading plan and questions remain complete.
61+
Native `query` and candidate previews keep their existing request contracts.
62+
3863
## Explicit Facts And Routing Explanations
3964

4065
Call `routing_facts` to discover fact IDs, aliases, types, allowed values,

‎docs/plans/README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,13 @@ Completed prerequisites do not close the parent objective. See the
1818
[Standards Agent Interface](standards-agent-interface/plan.md) delivers focused
1919
navigation, explicit-fact discovery and routing explanations, and bound authoring
2020
contexts over the Engine. It is `Accepted`; all three milestones and their acceptance checks are complete. It does not replace the active Standards Library Effectiveness effort.
21+
22+
## Engine Interface Efficiency Verification
23+
24+
[Agent Interface Efficiency](agent-interface-efficiency/plan.md) implements the
25+
user-authorized continuation of the interface-38 workflow simplification: schema
26+
presentation, bounded routed content and request-local evidence reuse. It is
27+
`Verifying`; local implementation evidence and remaining environment/client/review
28+
gates are recorded in its [verification](agent-interface-efficiency/verification.md)
29+
and [findings](agent-interface-efficiency/issues.md). This bounded code-maintenance
30+
slice does not close or replace Standards Library Effectiveness acceptance.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Findings
2+
3+
- E1 — qualification: local Python is outside the supported locked environment.
4+
Owner: integration. Run the unchanged locked CI checks before accepted integration.
5+
- E2 — client qualification: configured Codex/MCP SDK clients are not present locally.
6+
Owner: host operator. Retain default compatibility mode; run the optional client
7+
harness before selecting native presentation for that deployment. Raw stdio tests
8+
prove protocol consumption, not client rendering or model behavior.
9+
- E3 — acceptance: independent external review is not available in this execution.
10+
Owner: integration. Review the base-pinned diff and evidence before acceptance.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Ledger
2+
3+
## Admission
4+
5+
Pinned the newly pushed `34c2dcba` using its exact GitHub source bundle. Working tree
6+
was clean; work is on a private local feature branch. Read Core, routed actual task
7+
facts and relevant contract/implementation guidance. The current environment provides
8+
Python 3.13.5 and rpds-py 2026.5.1, not the locked supported 3.11/3.12 environment.
9+
No supported-runtime or live model-client acceptance is inferred from local checks.
10+
11+
The compatibility mode retains the existing supported-client workaround; native
12+
presentation is an explicit new selection rather than an unqualified default change.
13+
14+
## Implementation and review
15+
16+
- Added host-selected compatibility/native catalog presentation. Native chooses the
17+
smaller equivalent projection per input; application schemas gain no artificial
18+
reference overhead. Kept structuredContent and matching JSON text unchanged.
19+
- Added focused route-content paging over the existing read owner, with qualified
20+
closure, one snapshot/input, whole-item byte bounds and explicit continuations.
21+
- Added generated agent input variants and request-local typed evidence expansion;
22+
domain inputs and persisted evidence remain native. Table-less requests keep the
23+
original decoding path. Added sibling-equivalence and negative-boundary tests.
24+
- Corrected the new expander's Python/wire field-name mapping before qualification.
25+
Preserved native operation-specific uniqueness instead of inventing blanket rules.
26+
- Review found JSON Schema whole-number floats were valid but not Python indices.
27+
Normalized already-validated route counts, matching the existing workflow detail
28+
convention, and added a focused regression for both purposes and fractional rejects.
29+
- Updated affected generated-facade expectations and interface-version assertions.
30+
The existing main-advancement fixture mixed uncommitted new contracts with an old
31+
accepted tree and a new manifest; changed that one fixture to commit a coherent
32+
candidate before testing advancement. The Engine's rejection was correct.
33+
- Expanded the write set to those directly affected test consumers and the active
34+
plan index. No normative policy, approval, provenance, lock or stored-state change.
35+
- Local full coverage, targeted reruns, cold stdio measurements, retained interface-38
36+
contexts, generated freshness and structural checks are recorded in verification.
37+
Supported locked runtime, configured-client rendering and independent review remain
38+
distinct acceptance gates; none is inferred from local schema/unit success.
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Agent Interface Efficiency
2+
3+
Status: Verifying
4+
Acceptance: pending
5+
Base: `34c2dcbaf9aa7ade5589ae5c88383719dda81200`
6+
Operation: implement this plan; user-authorized continuation of the MCP simplification.
7+
8+
## Objective and admission
9+
10+
Reduce repeated schema descriptions, route/read round trips, and repeated evidence
11+
references without changing policy, exact authority, review or publication meaning.
12+
The first workflow simplification is already integrated; retain its immutable
13+
contexts, bounded work pages, explicit decisions and lightweight status reads.
14+
15+
The executable Router was run against the base with explicit task facts and no
16+
unresolved conditions. Selected concerns: implementation, verification, planning,
17+
documentation, build, development proportionality; library; generated-contract and
18+
IPC boundaries; contracts, architecture, dependencies, security, diagnostics and
19+
performance; code design, replay, schemas, protocol adapters, evolution and test
20+
oracles. No dependency, normative-policy or persistence-format change is planned.
21+
22+
The existing schema/compiler, facade, navigation projection and MCP transport own
23+
this work. No workflow store, evidence registry, model evaluator, session pointer,
24+
new authorization mechanism or general-purpose orchestration language is admitted.
25+
The composed design has three independent presentation concerns; existing domain
26+
operations still own routing, reads, evidence verification and decisions.
27+
28+
## Decisions
29+
30+
1. Host-selected MCP schema presentation: compatibility remains the default for
31+
known clients with incomplete nested-schema rendering. Native presentation uses
32+
the smaller complete inline/reference projection without schema text in descriptions.
33+
Both modes validate exactly the same inputs. No client-name heuristic or hidden
34+
downgrade; a restart chooses another catalog and its existing digest identifies it.
35+
2. Optional `route.content` requests a bounded page of selected exact compact reads.
36+
Route and reads share one snapshot and compiled input. Page count is bounded;
37+
byte pressure returns fewer whole items with an exact snapshot/facts continuation.
38+
Unknown facts, full dependency qualification and purpose filtering are unchanged.
39+
An oversized first record returns a bounded typed limit rejection, never a
40+
truncated policy. Plain route and explicit single/grouped reads remain supported.
41+
3. Authoring agent inputs may supply a request-local `evidence` table and typed
42+
`evidence_ref` uses. Generated agent input variants preserve native domain input
43+
types; the facade validates and expands only typed reference positions, then
44+
validates the native call before dispatch. Every use explicitly selects evidence.
45+
Missing/unused entries reject before effects; native evidence uniqueness is enforced after expansion.
46+
Provider/digest/current-authorization checks and expanded batch limits are unchanged.
47+
48+
## Compatibility and state
49+
50+
Interface 39 is an additive request capability and coordinated catalog update.
51+
Native authoring request types, Analysis request/state versions, all handles, SQLite,
52+
readiness, application and recovery representations stay unchanged. Application
53+
catalogs contain no authoring evidence variants. Native schema mode is opt-in until
54+
actual configured-client qualification is available. Restart/reconnect clients;
55+
preserve stores, proposals and exact contexts. No automatic retries or publication.
56+
57+
## Write set
58+
59+
- Engine canonical schema/interface and generated model/tool projections.
60+
- `tools.py`, `mcp.py`, `agent_navigation.py`, `context_projection.py`, plus one
61+
request-local evidence normalization module if required by its separate concern.
62+
- Focused contract, navigation, evidence and MCP tests; affected catalog consumers,
63+
examples and optional configured-client harness.
64+
- Engine READMEs/PURPOSE-SEPARATION and authoring/navigation/environment skill references.
65+
- This plan, ledger, issues and verification; generated suite-input manifest.
66+
67+
Directly affected consumers inside these owners may be added in the ledger.
68+
Normative content, approvals, provenance, locks and user stores are outside the write set.
69+
70+
## Acceptance
71+
72+
- Canonical native/agent schema validation and independent Draft 2020-12 validation
73+
agree for valid and malformed fixtures in both presentation modes; generated
74+
outputs are fresh. Input fields, omissions, recursion and extra-field rejection
75+
retain meaning. Runtime catalog identity tracks actual definitions; equivalent catalogs share an identity.
76+
- Route-content equals ordinary exact reads, including all pages; known missing
77+
facts stay unresolved; partial pages, oversized records, invalid selections,
78+
unavailable qualifications and snapshot lifecycle changes are explicit.
79+
One compiled input is used per call, without additional snapshot capture.
80+
- Shared and inline evidence produce identical exact native decisions/analysis and
81+
review outcomes. Alias errors, stale evidence, unsupported providers, foreign work,
82+
native uniqueness violations after expansion and expanded-size overflow publish nothing. Cold process
83+
reconstruction needs no alias table. Caller inputs remain unchanged.
84+
- Real stdio traces compare call counts and serialized request/result/catalog bytes
85+
against the base. Report tradeoffs; byte counts do not claim token/billing savings.
86+
- Focused and affected package suites, structural checkpoint and patch reconstruction
87+
pass. Supported locked Python 3.11/3.12, configured-client qualification and
88+
independent review remain separately named gates when unavailable locally.
89+
90+
## Sequence and next slice
91+
92+
Implement the three bounded concerns with tests, regenerate contracts, run integrated
93+
checks and measurements, then package changed files and review evidence. Current next
94+
slice: integration qualification and independent review after the local verification
95+
and base-pinned delivery. Implementation of the three admitted concerns is complete;
96+
remaining acceptance gates are tracked in issues.md and verification.md.

0 commit comments

Comments
 (0)