Repository navigation
Let a hive split its manifest into agents.json, tools.json and desks.json - #134
Conversation
Introduce a new split module under the document package to hold the logic for dividing documents into parts. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Manifest decoding now lives in a dedicated split module, and the shared decode path was factored so a value assembled from several files can be decoded without a single source text. Findings gained a relocate step that maps diagnostics back to the file and pointer they came from. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
When a document set is missing one of the required files, findings were returned before their file paths had been rewritten to point at the split file that actually holds the offending section. The early return now relocates findings through the same home lookup used elsewhere, and the local json helper is dropped in favour of the shared one. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The relocate helper now takes a callback returning an optional target file and leaves findings untouched when it returns None, and home reports the split file a finding belongs in as an Option instead of falling back to the original file. This lets callers decide whether a finding should move rather than always rewriting its file. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Diagnostics about sections kept in split files were reported against hive.json, so they now get remapped to the file that actually holds the section. The unowned-key rule also treats split files as part of the package and its message lists them. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a test that exercises loading a manifest split across multiple files, verifying the language layer resolves entries from each part correctly. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the split manifest tests and a document module call site to satisfy rustfmt, and corrected the goal edit in the permitted-edit test to use the description field rather than title. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Decoding now takes the parsed JSON value by reference and deserializes directly from it instead of cloning, and the split manifest uses a let-else to flatten the object check. This removes a redundant clone per document without changing the reported findings. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
The language spec now describes how a large hive.json may move its roles, seats, profiles, tools, toolpacks, mcp, skills, hooks, desks, topology and referrals sections into optional agents.json, tools.json and desks.json files, and how parsing assembles them back into one manifest. The crate docs and the document module README were updated to match, and a new split/ README covers where findings for the moved sections are reported. Auto-committed-on: cuttlefish Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): Let a hive split its manifest into agents.json, tools.json and desks.json. This pull request lets a hive split its manifest across three optional package-root files (`agents.json`, `tools.json`, `desks.json`) so a large `hive.json` is easier to read and edit. Parsing decodes each present split file on its own as a typed struct that denies unknown fields, then assembles the sections into one `Manifest` before decoding, so validation, lowering, patches and content identity cannot distinguish a split package from a single-file one. Findings about moved sections are relocated to the split file holding the section at the same JSON Pointer, and `check` treats the new files as package files. Review snapshot
Completeness: Complete What changedAdds a `document/split` module defining the three split files, the sections each owns, their typed wire structs, assembly into the manifest, and a `home` function naming the split file a finding belongs in. `document::collect` delegates manifest decoding to `split::manifest` and relocates findings via the new `Findings::relocate`. `decode` is refactored around a new `decode_value` that tolerates a missing single source text, so an assembled manifest reports serde's message without line and column. In `check`, diagnostics are relocated to the split file the edit kept the section in, and `outside_package` no longer flags split files as unowned, with an updated message. Docs and shell-level documentation (`document/README.md`, `document/split/README.md`, `lib.rs` crate overview, and `docs/specs/hive-language.md`) describe the split and its location rules. Features
Tests
FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
A big
hive.jsonis hard to read and edit. A hive may now move some of its manifest's top-level sections into three optional files at the package root, each a JSON object holding those sections under their usual keys:agents.jsonroles,seats,profilestools.jsontools,toolpacks,mcp,skills,hooksdesks.jsondesks,topology,referralsParsing assembles them into the one
Manifestbefore decoding (document/split/). Validation, lowering, patches, lineage and content identity therefore can't tell a split package from a single-file one. Moving a section between files is no change forcheck.check, names the split file at the same JSON Pointer (agents.json:/seats/0/role).hive.jsonand its split file is ajsonfinding at/<section>in the split file.checktreats the split files as package files, not as files outside the package.Public API / behaviour changes
agents.json,tools.jsonanddesks.json. A package without them parses exactly as before.outside_packagemessage lists the new files.hive.json's own sections of a split package has serde's message without a line and column, because the assembled manifest has no single source text. Single-file packages keep line and column.diagnose(&Package), which sees no files, still reports inhive.json. The serializedPackageholds one manifest, soPackageSource::newwrites onehive.jsonas before.Validation
cargo fmt --all -- --check: cleancargo clippy -p tinyhivemind-lang --all-targets -- -D warnings: cleancargo test -p tinyhivemind-lang: all pass, including the newtests/split_manifest.rs(7 tests: the galleryself-improvingpackage split parses and lowers equal to the original, partial splits, duplicate sections, foreign sections and non-object files, findings located in the split file,checklocating a forbidden edit inagents.jsonand giving the same review as the single-file edit, moving sections being no change) anddocument/split/test.rs(the typed files hold exactly their sections, each section has one owner,home).RUSTDOCFLAGS="-D warnings" cargo doc -p tinyhivemind-lang --no-deps: cleanDocs:
docs/specs/hive-language.mdgets a new "Splitting the manifest" section, and the crate overview table anddocument/README.mdare updated. There is a newdocument/split/README.md.