Repository navigation
Add bounded structural code tools and typed source patterns - #74
AmirrezaFarnamTaheri wants to merge 12 commits into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Comment |
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): Add bounded structural code tools and typed source patterns. The change adds a pure tinytools-code crate for bounded lexical parsing, revision-checked patches, and typed boilerplate rendering, plus an optional code feature in tinytools-std exposing six FsGate-backed deferred tools, and merges upstream cross-platform compatibility fixes (non-Linux group_exit::wait returns a Ready future, empty/whitespace/NUL DNS hosts are rejected, environment and git test helpers are platform-gated). No actionable findings are reported. The latest-push delta could not be computed from a trusted comparison. Unreviewed paths
Review snapshot
Completeness: Complete What changedAdds a new pure tinytools-code crate (Cargo.toml, lib.rs, analysis/engine/catalog/render/patch modules with eight compiled grammars and query packs) plus an optional tinytools-std code feature wiring six FsGate-backed tools, and merges upstream compatibility fixes gating non-Linux timeout group_exit::wait, rejecting empty DNS hosts in url_guard, and platform-gating workspace_state and timeout test helpers. Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: .github/workflows/openhuman-tinytools-sync-once.yml, README.md, crates/tinytools-code/Cargo.toml, crates/tinytools-code/README.md, crates/tinytools-code/benches/structural.rs, crates/tinytools-code/src/analysis/README.md, crates/tinytools-code/src/analysis/extract.rs, crates/tinytools-code/src/analysis/fold.rs and 77 more.
$0.0001 · 0 in / 0 out · 703 embedded · ladder/vectors-oai3
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: README.md, crates/tinytools-code/Cargo.toml, crates/tinytools-code/README.md, crates/tinytools-code/benches/structural.rs, crates/tinytools-code/src/analysis/README.md, crates/tinytools-code/src/analysis/extract.rs, crates/tinytools-code/src/analysis/fold.rs, crates/tinytools-code/src/analysis/mod.rs and 76 more.
$0.0001 · 0 in / 0 out · 702 embedded · ladder/vectors-oai3
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: README.md, crates/tinytools-code/Cargo.toml, crates/tinytools-code/README.md, crates/tinytools-code/benches/structural.rs, crates/tinytools-code/src/analysis/README.md, crates/tinytools-code/src/analysis/extract.rs, crates/tinytools-code/src/analysis/fold.rs, crates/tinytools-code/src/analysis/mod.rs and 76 more.
$0.0001 · 0 in / 0 out · 702 embedded · ladder/vectors-oai3
There was a problem hiding this comment.
tinysweeper found nothing blocking, but could not review everything, so this is not an approval: README.md, crates/tinytools-code/Cargo.toml, crates/tinytools-code/README.md, crates/tinytools-code/benches/structural.rs, crates/tinytools-code/src/analysis/README.md, crates/tinytools-code/src/analysis/extract.rs, crates/tinytools-code/src/analysis/fold.rs, crates/tinytools-code/src/analysis/mod.rs and 76 more.
$0.0001 · 0 in / 0 out · 702 embedded · ladder/vectors-oai3
|
Updated the branch through 8ac07cc. Merged current upstream main without rewriting history and resolved the manifest conflict by aligning the optional structural-code dependency with workspace v0.6.0. Validation also exposed two Windows issues: blank DNS names are now rejected explicitly before OS resolution, and the environment test checks an inherited Windows variable rather than Git Bash's synthesized HOME. Non-Linux cleanup and Unix-only test helpers now pass all-targets Clippy. Local all-features tests and doctests, all-targets build, Clippy with -D warnings, and formatting pass. New fork and upstream CI runs are being checked. The earlier automated review reported incomplete coverage, not an actionable source finding; this update does not treat that as approval. |
|
Final follow-up a49d5f9 restores deterministic OS resolver-error coverage with an embedded-NUL hostname; it performs no external DNS query. Both the fork CI run (39951692725) and upstream PR CI run (39951699555) now pass every job, including per-file 90% coverage. GitHub reports no merge conflict. |
Canonical upstream compatibility — October 18, 2026
Merged TinyTools canonical main
e1c9683f546434e6147d02e4d837eae16e3d48bainto the structural code branch without dropping the new bounded structural engine. Current fork head:0d349716deafc4d91a595bf85400e8445cd1a6e8; zero behind this upstream revision. Canonicalworkflow_dispatchwas restored, the temporary merge workflow removed, and fork CI completed successfully.Summary
Add reusable structural code inspection and boilerplate rendering for agent tools. The new pure
tinytools-codecrate owns parsing, bounded analysis, revision-checked edits, and typed chunk rendering. An optionaltinytools-stdadapter exposes these operations through the host's existingFsGate.The dependency-light
tinytoolsvocabulary keeps its existing dependency tree.Related issue
None. Consumer integration: OpenHuman #14.
API or behavior changes
This is additive. The native adapter requires the new optional
codefeature.CodeEnginesupports explicit Rust, TypeScript, TSX, JavaScript, Python, Go, JSON, and TOML grammars. It provides bounded caching, incremental parsing, lexical outlines, diagnostics, folded bodies, and revision-checked targeted patches.ChunkCatalog, typed manifests, and one-pass rendering provide twelve starter patterns, validated parameters and slots, and bounded custom templates. Node constraints must refer to visible, named nodes in the selected grammar. Dependency declarations are informational; rendering does not install them.code_toolsandcode_tools_with_optionsexpose six deferred tools:ast_outline,ast_symbol,ast_patch,chunk_search,chunk_inspect, andchunk_apply. Outline level defaults to1; level0omits the folded skeleton. Chunk search defaults to five results, capped by the configured page limit.dry_run: truerequests a read-only preview. Custom manifests resolve templates within their own directory, and application checks both template and destination revisions.Structural validation establishes syntax and selected source ranges. It does not provide typechecking or semantic reference resolution. Source-byte and entry limits bound the retained source cache, but do not establish an allocator-level bound on tree-sitter memory. Publication does not provide filesystem compare-and-swap against unrelated writers or a power-loss durability guarantee.
Validation
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo build --all-targets --all-featurescargo test --all-featuresThe final source passes workspace formatting and strict Clippy on Rust 1.99. Focused tests on Rust 1.96.1 pass: 43 pure-engine tests and 35 native-adapter tests, plus execution of the fixed-fixture benchmark.
Final-revision CI passes the workspace build, both feature configurations of the test suite, the dependency-light vocabulary check, strict documentation, supply-chain checks, and the Rust 1.88 build. The unchanged 90% per-file coverage gate passes all 156 executable source files. The minimum for the new pure-engine files is 94.02%; the minimum for the native adapter is 93.66%. The UTF-8 edit-boundary module is fully covered.
Tests
New regressions cover all eight grammars, partial UTF-8 prefix and suffix edits, cache and output bounds, outline levels and pagination, selector ambiguity, stale revisions, import placement, comment and indentation preservation, typed expansion, and grammar-specific manifest constraints.
Native tests cover custom-template containment, bounded UTF-8 and escaped JSON arguments, late permission revocation, cancellation, staged publication races, no-clobber creation, response-size preflight, and permission preservation. The final available action-budget unit remains usable.
Documentation
The PR adds an accepted specification, a linked implementation plan, crate and module documentation, API examples, and benchmark usage notes.
Checklist
#[allow(...)],#[ignore], or relaxed lints.envcontents in the diff or the descriptionNative test modules use a test-only
clippy::unwrap_usedallowance consistent with neighboring filesystem tests. Production lints, CI, and coverage rules are unchanged; no tests are ignored.