Slice 020: Tool protocol + registry - #26
Merged
Merged
Conversation
ROADMAP row 020 to in_progress. NOTES.md carries the ten-line build plan (the behaviour, the schema validator on jsv, the registry with the namespaced dynamic tools and the compile-time catalog rule, the permissions stub, the concurrent runner replacing 012's stub, the declared surface), the empty manual queue, and four deviations stated before any code. plan_check: PASS. Signed-off-by: Ayla Croft <aylacroft@proton.me>
Already locked at 0.23.0 through req_llm; Trinity.Tools.Schema calls it, so it is named in mix.exs and VERSIONS.md (ADR-0009: Trinity's own tool behaviour with jsv for its schemas). mix.lock unchanged. Signed-off-by: Ayla Croft <aylacroft@proton.me>
…he catalog rule Lines 1 to 9 of the G1 plan. Trinity.Tools.Tool (name, description, a JSON Schema, risk, effect, execute/2, optional timeout/0 and format_result/1), Context, Result with cap/2 (64 KB, a marker, original_bytes in meta), Schema.validate/2 on jsv with cast: false. Trinity.Tools.Registry (GenServer over ETS in Trinity.Tools.Supervisor with the task supervisor): core tools from config :trinity, :tools, dynamic ones through register/2 with the namespaced-name rule, the reserved core names, the schema check and the refusal of a :catalog claim; definition digests. Trinity.Effects.Catalog, the compile-time attribute (empty). Trinity.Permissions: tier/1 from a code-owned map (empty at this slice, every name :ask), the Policy behaviour, the default that allows, the implementation from config. Trinity.Tools. Runner: every call of a turn at once under the task supervisor, each with its tool's timeout, lookup, validate, decide once, execute, cap; crashes, timeouts and unknown names are error results. The Session calls run_all/2, writes one tool row per answer with tool_result and tool_definition_digest, puts the declared surface into the request and onto the assistant row; Trinity.Tools.surface_diff/1 over a history. Tests, 27 in test/trinity/tools: AC1 (four test tools listed with schemas and digests; no lib module names a test tool), AC2 (two 300 ms sleeps under 500 ms, two rows, a final message), AC3 (a raise and an exit are error rows, the session goes on, both supervisors keep their pids), AC4 (a 5 s sleep against a 500 ms timeout answers within 600 ms), AC5 (truncated row, marker, original size), AC6 (a Mox tool's execute/2 never called on bad arguments), AC7 (a Mox policy's decide/3 exactly once per call), AC8 (the census over the app's module list: two plants claiming :catalog are named; the runtime path and the config path are both refused by name), AC9 (an impostor named echo refused; a namespaced echo gets :ask). The 012 tool-path test reads the runner's "no such tool" now. Gate exit 0, 204 tests; credo --strict --all clean. Signed-off-by: Ayla Croft <aylacroft@proton.me>
PROOF.md with every criterion's evidence: AC1 live (a fifth tool, one config line, an empty lib/ diff) and in the suite, AC2 to AC7 through the Session with the fake provider's tool calls and two Mox mocks, AC8 the census over the application's module list with two plants named, AC9 the impostor refused. NOTES.md carries the nine findings, three of them G1 deviations that boundary reversed. coverage.tsv: 020 at 67.18% from 64.41%. ROADMAP row 020 to done. Gate exit 0, 204 tests. Signed-off-by: Ayla Croft <aylacroft@proton.me>
Signed-off-by: Ayla Croft <aylacroft@proton.me>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 020 per
slices/020-tool-protocol-registry/SLICE.md. Evidence in itsPROOF.md; findings and follow-ups in itsNOTES.md.Trinity.Tools.Tool(Trinity's own behaviour, ADR-0009), registry over ETS, jsv validation (refuse, never repair), the compile-time effect catalog with its census (AC8), the permissions stub with a code-owned tier map, the concurrent runner with per-tool timeouts.jsvbecomes a direct dependency (already locked). No other lock change.