feat(reason): read-only tool registry, bounded loop and audit trail for unit 6 - #56
Merged
Merged
Conversation
…or unit 6 pkg/reason is the unit-6 core from design §9: a read-only tool registry, the reasoning loop, an audit trail, budget enforcement and injection defence. No SDK, no network, no go.mod change. Provider is an interface; the only implementation in-tree is a test fake. Write-capable tools are not merely unregistered — the type makes them unregisterable, so adding one requires editing Register's predicate in a visible diff. Every string a tool returns is attacker-controlled and is treated as such against an adversarial corpus. The budget bounds the loop, not the individual call: budget exhaustion is a first-class terminal outcome carrying partial evidence, so callers must not infer success from err == nil. airgap_test.go parses the package's own AST to seal its import set rather than tracking a maintained list. Co-authored-by: kording <74226694+kording@users.noreply.github.com>
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.
pkg/reason is the unit-6 core from design §9: a read-only tool registry, the
reasoning loop, an audit trail, budget enforcement and injection defence.
No SDK, no network, no go.mod change. Provider is an interface; the only
implementation in-tree is a test fake. Write-capable tools are not merely
unregistered — the type makes them unregisterable, so adding one requires
editing Register's predicate in a visible diff. Every string a tool returns is
attacker-controlled and is treated as such against an adversarial corpus.
The budget bounds the loop, not the individual call: budget exhaustion is a
first-class terminal outcome carrying partial evidence, so callers must not
infer success from err == nil. airgap_test.go parses the package's own AST to
seal its import set rather than tracking a maintained list.