Skip to content

Choose a seat's harness in the hive language, default-deny - #137

Merged
sanil-23 merged 44 commits into
tinyhivemind-hostfrom
harness-schema
Nov 26, 2026
Merged

sanil-23 merged 44 commits into
tinyhivemind-hostfrom
harness-schema

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

Step 3 of the process harness plan: the hive language can say which harness each seat runs on, and check refuses what that harness cannot honour.

  • Schema. A harnesses section (id, kind, isolation) and harness on runtime, profile and seat, resolved most-specific-wins. Absent means OpenHuman. An absent field is not written out, so existing package ids are unchanged; ids for all 9 example packages and both fixtures are pinned from the code before this change. An explicit null or an empty harnesses list is a decode error.
  • Capability table (HarnessKind::support). It is consulted only once a package names a harness anywhere, and then it judges every seat. It is default-deny: a field with no decision is rejected. A drift test derives each type's field list from its decoder, so a new optional field cannot slip past it.
  • What a process harness can run today. Prompt, model name, hive and executable tools, timeouts, and an openai provider with an explicit endpoint and no credential. Everything else is rejected until a conformance test proves it: credentials, other providers, skills, temperature, budgets, tool allow and deny lists, send limits, stop hooks, sandboxes and built-in tool groups.
  • Built-in tools are off. A package that names a harness lowers every tool group it does not list to off, and the linked adapter applies that. An end-to-end test showed use_skill reaching the model before the fix.
  • Edit classes. Moving a seat to another harness, directly or through its profile, needs the integration class as well as roster, in both check and patch::guard.
  • Adapter guard. The linked adapter refuses any seat whose resolved harness is not OpenHuman, and two packages declaring one harness differently, so the field is never accepted and ignored.
  • Diagnostics at each field's JSON Pointer, for every case above plus the turn and call argument rule. Example packages: examples/hives/mixed-harnesses checks clean, and examples/broken/harnesses reports its 10 designed findings.

Stacked on #136.

Related issue

None. Refs #136.

API or behavior changes

  • New public types in tinyhivemind-lang: Harness, Isolation, Capability, Support, Unlock, LoweredSeatIntegration::{harness, unlisted_groups}.
  • tinyhivemind-openhuman gains DeployError::UnsupportedHarness and ConflictingDeclaration.
  • No behaviour change for a package that names no harness.

Validation

At 7c66eb86:

  • cargo fmt --all -- --check: pass
  • cargo clippy --all-targets --all-features -- -D warnings: pass
  • cargo build --all-targets --all-features: pass
  • cargo test --all-features: 1899 passed, 0 failed, 0 ignored
  • assert-pure.sh (lang stays pure), rustdoc -D warnings: pass
  • hive_check on every example: no findings on examples/hives/*; 10 on broken/harnesses, 5 on broken/integrations
  • Coverage of touched lang files: 98.6% to 100%

CI will show the same red checks as #136, all already on main: the examples/openhuman tests, the two coverage files and the RUSTSEC advisories.

Tests

Each fix was written as a failing test first, except one adapter-guard test and one frontmatter test that pin behaviour the existing rules already gave. An independent review found two gaps (an unmapped field was accepted; built-in tools defaulted on). Both are fixed with tests.

Deliberately open: an edit allowed to change a hive's roster can still change a seat's other integration fields. That gap was already there before this change, and the spec lists it under "Open questions".

Documentation

docs/specs/harnesses.md (capability rows, unlisted means off, open questions), hive-language*.md, crate and module READMEs, the crate doc, and the example and broken package READMEs.

Checklist

  • The change is focused on one logical change
  • No new #[allow(...)], #[ignore], or relaxed lints
  • No secrets, tokens, or .env contents in the diff or the description

Co-authored-by: Medulla medulla@tinyhumans.ai

senamakel and others added 30 commits November 25, 2026 23:34
Add tests covering content id generation and stability for language
inputs, verifying that identical content yields the same id and that
distinct content produces distinct ids.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replace the placeholder sha256:x expectations with the actual content ids for each example hive and fixture, and compare the full set in one assertion so a mismatch reports every differing package at once.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add tests for decoding and re-encoding harness entries, the optional isolation field and its per-kind default, and the harness references on runtime, profiles and seats. The tests also pin down that absent harnesses are omitted from the wire form while explicit nulls and empty harness lists are rejected, so a written value always survives a round trip.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a types module exporting Harness and Isolation, and give HarnessKind an ALL list plus a default_isolation method so callers can derive how instances are shared when a harness entry omits it. OpenClaw defaults to one instance per deployment because its instance is expensive, while the other kinds default to one per seat.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a harness field on seats, runtime settings and profiles plus a manifest-level harnesses list, all omitted from serialization when unset so existing packages keep their content id. New present and nonempty deserializers reject null and empty-list inputs that would otherwise vanish on the round trip.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The document module no longer re-exports the unused `nonempty` helper, while the crate root now publicly exposes `Harness` and `Isolation` alongside `HarnessKind` so callers can name the harness types directly.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…e and default

Seats now carry a resolved harness reference so lowering can report which harness a seat runs on, falling back through seat, profile and runtime settings to OpenHuman when nothing is declared.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a sample hive that combines multiple harnesses with a shared constitution, memory file, and a word_count tool so the mixed-harness setup can be demonstrated and tested.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Generalised the integrations example loader into a shared `example` helper that takes a package name, and made the diagnostic matcher visible to sibling test modules so new example packages can be validated without duplicating the file-walking logic.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a test harness module to support the validation test suite, giving the tests a shared setup for exercising validation behaviour.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a Capability enum with per-kind support rows and unlock reasons, plus model API and iteration cap metadata for each harness kind. Validation now rejects a delegated profile that sets its own harness, since it runs inside its parent's agent.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a new validation module for checking capability declarations in the language. This provides the groundwork for rejecting invalid capability usage during validation.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The layered limits lookup now builds an array of optional pairs and flattens it before searching, replacing the previous tuple-of-options construction. This removes the redundant unwrap_or_default calls and makes the fallback order easier to read.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The crate root now re-exports Capability, ModelApi, Support, and Unlock alongside the existing harness types so downstream users can reach them without importing the harness module directly.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Capability findings are now collected in a buffer keyed by location so a
setting shared by several seats is reported once, for the first seat that
resolves to it, instead of once per seat.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a harness module for the check tests and widen the visibility of the example fixture helper so it can be reused across test modules.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Seat moves between harnesses are now detected and rejected unless the constitution permits integration edits, since a roster-only patch could otherwise relocate a seat. The harnesses section is also treated as integration-owned.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The split document format now accepts a `harnesses` section in `agents.json`, so manifests that declare harnesses can be split and reassembled without losing them. Diagnostics for harness entries are reported against that file, and the patch class docs note that moving a seat to another harness also requires the integration class.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add tests asserting that a seat's frontmatter may only restate its own harness and cannot unset it, and that deployment refuses seats on unsupported harnesses or packages that disagree on a harness declared under the same id.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the package deployment tests to reference the harnesses function through its full crate path instead of the imported shorthand, keeping the test module resolving correctly.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The linked adapter now refuses seats whose resolved harness is not openhuman, since it cannot start a harness process, and rejects packages that declare the same harness id differently. This prevents deployments that would otherwise silently ignore those seats.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…tests

Extracted the inline package setup used by the harness validation tests into a reusable `openhuman_only` helper so both tests build their fixtures the same way. The second test now derives its conflicting package from that fixture instead of constructing one from scratch.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The assertion in the conflicting-declaration test now checks for the harness id claw instead of oh, matching the fixture the test builds.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a mixed-harnesses example package and a broken variant that exercises
harness validation, with a test pinning each of the eight findings it
reports. The examples READMEs now list the new package and how to check it.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
… table

Expand the harness module docs and the language, integration and harness specs to cover the `harnesses` section, seat resolution and the capability table, and note that harness fields are omitted from serialization when absent so older packages keep their content ids.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Renamed local bindings in the capability judge and harness test helper so they no longer shadow or misname the values they hold, and adjusted doc comments to use consistent casing for harness names. No behaviour changes.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…comment

Wrapped the `OpenHuman` reference in the `UnsupportedHarness` doc comment in backticks so it renders as code, matching the surrounding documentation style.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Extend the capability table with eighteen more settings from the spec, such as skills, budgets, model parameters, tool lists and runtime options, and mark them rejected until the spec decides them. Rename the Decision unlock to Spec to reflect that a spec change, not just host work, is what moves these rows.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Validation now reports unknown harness fields at their own JSON pointer instead of collapsing them to the parent object, and a new test asserts that every field absent from the spec's table is rejected wherever it is set. The mixed-harnesses example drops its tool deny lists and deployment id so it no longer relies on settings the spec leaves undecided.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel and others added 14 commits November 26, 2026 00:03
…ults

Capability checking now walks every object a seat runs with against its default and rejects any field set to a non-default value whose capability the harness kind does not support, instead of only inspecting a fixed set of layers. This makes the check default-deny so newly added fields are covered without further changes here.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ged seats stay offline

The broken harness example no longer carries per-seat web deny lists, since a package that names a harness cannot have one, and its deployment id is cleared while concurrency rises to four. The gallery test now tracks which packages are judged and verifies their seats leave every built-in tool group off, keeping them off the web without a deny list.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The harness docs now describe `fields.rs`, which maps every field of every integration type to a capability, a structural exemption, or a by-value rule, and the capability check walks each seat's settings against it so any field set away from its default must be granted. The spec records that the last nine capability rows were added this way, that a test fails when a new field has no entry, and that send limits and tool lists start rejected because the adapter's permission gate enforces them rather than the host.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The README now reflects the current set of judged fields, including the sqlite and host session store options, in-process and host memory engines, and stop hooks, and clarifies that limits.iterations is rejected on OpenHuman and above its cap there.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ty arm

Moved the BuiltinToolRules match arm into the group of capabilities that start rejected, since the spec's first table does not decide them and nothing on the process path enforces the setting. Also corrected the doc comment to backtick OpenHuman and clarified that it is the spec's first table that leaves these undecided.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The capability coverage test now derives each type's field list from its
deserializer error rather than from a serialized sample, so fields skipped
when absent are still checked against the capability table. The capability
module was split into a directory to hold its own tests.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add tests asserting that a setting rejected by several harness kinds keeps each kind's reason, that the sections a seat reaches are walked, and that a judged package lowers unlisted tool groups to off. Deduplicate integration pointers in the harness helper so repeated findings for one setting do not skew assertions.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Packages that name a harness now lower unlisted tool groups to off, so no built-in tool stays enabled unless the package opts in. The judged check moved into harness resolution so lowering and validation share it, and a test covers runtime harness edits counting as a single move.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…s kind

Capability validation now emits a finding for each harness kind that rejects a field, so a provider credential or runtime sandbox rejected by both the openclaw and codex seats is reported twice with each kind's reason. The broken harness example and its pinned report were updated to expect ten findings instead of eight.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a seat_groups helper that lowers a seat's tool groups from its toolpacks, turning every unlisted group off for packages that name a harness while leaving the runtime defaults intact for those that do not. Tests cover the new isolation handling and confirm a judged seat deploys with no built-in tool group.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…sage

The assertion that a judged seat deploys with no built-in tool group now
reports the number of requests the mock model received and details of the
first one, so a failure shows what the deployment actually sent.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The judged-seat deployment test now clears the package runtime provider instead of overriding the top-level provider and endpoint, so the linked adapter falls back to the fixture's injected provider and the seats deploy offline. The failure assertion was also simplified to drop the request dump.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Two packages declaring the same harness id are now only a conflict when they disagree on the kind or the resolved isolation, so identical declarations no longer fail. Seats of a package that names a harness also lower with unlisted tool groups off, closing the gap where the runtime's defaults left them callable through use_skill.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Moved the hook declaration and stop-hook rejection out of the seat
validation loop into a dedicated `hooks` helper, and tidied the toolpack
indexing so it is walked once. Behaviour is unchanged; the split keeps
the seat walk readable as more capability checks are added.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cdda2f91-69d9-499f-8cd8-c0abffc94ed7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-26T00:37:56.675842Z
We couldn’t complete this review. Comment @codex review to try again.
7c66eb8 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sanil-23
sanil-23 merged commit b77c6bc into tinyhivemind-host Nov 26, 2026
5 of 9 checks passed
sanil-23 added a commit that referenced this pull request Nov 26, 2026
Brings in #137 (harness schema). The one conflict is the "Implemented so
far" paragraph of docs/specs/harnesses.md, now covering steps 1, 2 and 3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sanil-23 added a commit that referenced this pull request Nov 26, 2026
Brings in #137 (harness schema) and #138 (hive tool server). Conflicts:

- Cargo.toml: both new members, and both dependency blocks (hyper and its
  helpers for tinyhivemind-mcp, reqwest for this crate).
- assert-pure.sh: host_crates now guards tinyhivemind-host,
  tinyhivemind-mcp and tinyhivemind-openhuman-process.
- docs/specs/harnesses.md: "Implemented so far" covers steps 1, 2, 3 and 4b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants