Skip to content

Let a hive split its manifest into agents.json, tools.json and desks.json - #134

Merged
senamakel merged 10 commits into
mainfrom
split-hive-manifest
Oct 25, 2026
Merged

senamakel merged 10 commits into
mainfrom
split-hive-manifest

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

A big hive.json is 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:

File May hold
agents.json roles, seats, profiles
tools.json tools, toolpacks, mcp, skills, hooks
desks.json desks, topology, referrals

Parsing assembles them into the one Manifest before 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 for check.

  • Locations. Each split file is first decoded on its own as a typed struct that denies unknown fields, so a schema error, or a section the file doesn't own, is reported in that file with serde's line and column. After that, every finding about a moved section, from parsing, validation or check, names the split file at the same JSON Pointer (agents.json:/seats/0/role).
  • One home per section. A section declared in both hive.json and its split file is a json finding at /<section> in the split file.
  • check treats the split files as package files, not as files outside the package.

Public API / behaviour changes

  • New optional package files agents.json, tools.json and desks.json. A package without them parses exactly as before.
  • The outside_package message lists the new files.
  • A schema error in 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 in hive.json. The serialized Package holds one manifest, so PackageSource::new writes one hive.json as before.

Validation

  • cargo fmt --all -- --check: clean
  • cargo clippy -p tinyhivemind-lang --all-targets -- -D warnings: clean
  • cargo test -p tinyhivemind-lang: all pass, including the new tests/split_manifest.rs (7 tests: the gallery self-improving package split parses and lowers equal to the original, partial splits, duplicate sections, foreign sections and non-object files, findings located in the split file, check locating a forbidden edit in agents.json and giving the same review as the single-file edit, moving sections being no change) and document/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: clean

Docs: docs/specs/hive-language.md gets a new "Splitting the manifest" section, and the crate overview table and document/README.md are updated. There is a new document/split/README.md.

senamakel and others added 10 commits October 25, 2026 09:20
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>
@tinysweeper

tinysweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: 2a901baa5439325f8608db6b3a366c6bec472299

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 11 of 11 files.
Pull request purpose (title): Let a hive split its…

Diagnostics and supporting details

Full summary

Pull 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

Change surface Files Review signal Count
Production 6 Active findings 0
Tests 2 Noted findings 0
Documentation 3 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: Test coverage is assessed from changed tests and lane evidence; execution is not claimed without trusted check data.

What changed

Adds 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

  • Added — Optional manifest split over agents.json, tools.json and desks.json: A hive may move roles/seats/profiles, tools/toolpacks/mcp/skills/hooks, or desks/topology/referrals out of `hive.json` into optional files at the package root, which are assembled into one manifest before decoding so downstream behavior is identical. (crates/tinyhivemind-lang/src/document/split/mod.rs, crates/tinyhivemind-lang/src/document/mod.rs pub(crate) fn collect(documents: &BTreeMap<String, String>) -> (Option<Package>,, docs/specs/hive-language.md and unsupported schema/version values fail rather than disappearing during a)
  • Added — Per-file typed decoding with line and column errors: Each split file is decoded on its own as a struct that denies unknown fields, so a schema error or a section the file does not own is reported in that file with serde's line and column; an assembled manifest reports serde's message alone because it has no single source. (crates/tinyhivemind-lang/src/document/split/mod.rs, crates/tinyhivemind-lang/src/document/mod.rs fn decode<T: serde::de::DeserializeOwned + serde::Serialize>()
  • Added — Findings relocated to the split file that holds the section: Findings from parsing, validation and `check` about a moved section name the split file at the same JSON Pointer (for example `agents.json:/seats/0/role`), so diagnostics point where the editor wrote the section. (crates/tinyhivemind-lang/src/diagnostic/mod.rs impl Findings {, crates/tinyhivemind-lang/src/check/mod.rs pub fn check(, crates/tinyhivemind-lang/src/document/split/mod.rs)
  • Modified — check treats split files as package files: `outside_package` no longer reports changes to the new split files as unowned, and its message lists them among the files that are read. (crates/tinyhivemind-lang/src/check/rules.rs pub(super) fn outside_package(, crates/tinyhivemind-lang/src/document/README.md package's files into a `BTreeMap<String, String>` and calls `parse`; this)

Tests

  • integration — The gallery `self-improving` package, split across the three files, parses and lowers equal to the one-file original, and its split `hive.json` no longer holds `seats` or `tools`.: The tests lane reports this real behavioural test asserts the split package parses and lowers identically to the single-file one and found no defect; execution was not verified by trusted check evidence. (crates/tinyhivemind-lang/tests/split_manifest.rs)

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The critique lane answered, reviewing 11 of 11 files with no findings listed.
  • Lane summary: Reviewed 11 files; 2 findings. _The code index is behind this pull request (indexed at `f40d1c6488ee`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The security lane answered with no findings across 8 of 8 reviewable files; the three prose/spec files were not security-reviewed as prose or tabular data.
  • Lane summary: Reviewed 8 files; 0 findings. 3 files were not security-reviewed: crates/tinyhivemind-lang/src/document/README.md (prose or tabular data), crates/tinyhivemind-lang/src/document/split/README.md (prose or tabular data), docs/specs/hive-language.md (prose or tabular data). _The code index is behind this pull request (indexed at `f40d1c6488ee`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: This adds optional manifest splitting over `agents.json`, `tools.json` and `desks.json`, relocating findings into the split file that holds the section, and is backed by a real behavioural test (`a_split_manifest_parses_and_lowers_like_one_hive_json`) asserting the split package parses and lowers identically to the single-file one, alongside tests for duplicate sections, unowned sections, relocated pointers, and check reporting. I found no defect in the diff: no regressions, no coverage gaps on the new branches, and no repository-rule violations. _The code index is behind this pull request (indexed at `f40d1c6488ee`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The commits lane answered and reports no sensitive content in committed files.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `f40d1c6488ee`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The description lane answered that the split is implemented as described, including assembly into one `Manifest`, relocation via `split::home` in both `diagnose_documents` and `check`, duplicate-section reporting in the split file, and the updated `outside_package` message, with nothing contradicting the stated contracts.
  • Lane summary: The manifest split is implemented as described: optional `agents.json`/`tools.json`/`desks.json` (constants `AGENTS`/`TOOLS`/`DESKS`, table `SPLITS`) are decoded on their own, assembled into one `Manifest` before decoding, findings are relocated via `split::home` in both `diagnose_documents` and `check`, duplicate sections are reported in the split file, and `check` treats the new files as package files with an updated `outside_package` message. The module layout, docs and tests match the stated API changes, and I found nothing in the diff that contradicts the description or breaks a stated contract. _The code index is behind this pull request (indexed at `f40d1c6488ee`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.001654
  • Tokens: 1088170 input · 15382 output · 47616 cached · 766 embedding
  • Updated: 2026-10-25T09:25:57Z
Head State Pass summary
2a901baa5439 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-25T09:25:57Z)

tinysweeper 0.1.2

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-25T09:24:40.218046Z 2a901ba PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant