Repository navigation
Hive language: gallery, direct-edit checker, hive_view, live UI and euler_hive - #126
Conversation
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. |
|
Important Review skippedToo many files! This PR contains 397 files, which is 297 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configuration
⛔ Files ignored due to path filters (1)
📒 Files selected for processing (397)
You can disable this status message by setting the
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bc5564617
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The hive_view example now streams frames from a live provider instead of only using static data, so the demo can show real-time updates. A new provider module wires the live source into the existing frame loop. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add live prompt and provider panels to the hive view example so the routing demo can show how prompts and providers are wired together at runtime. The output and routing test files are updated to exercise the new views. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tiny Sweeper review
|
The referral decision logic in route is now a separate decide method that returns the decision and intended desk, or None when the line addresses no other desk. The record kind is also derived from the sent status and referral kind rather than only overriding returns. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add an example that renders the hive view output and document the corresponding language checking behaviour in the spec. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reorganize the diagnostic type definitions to improve clarity and maintainability without changing any behaviour. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reorganize the diagnostic module to improve code clarity and maintainability without changing any behaviour. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reorganize the validation module to improve clarity and make the validation logic easier to extend. No behaviour change is intended. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Bounds checks now report an error when a value falls outside the permitted range rather than silently clamping it to the nearest limit. Clamping hid misconfigured inputs from callers, so the validation now surfaces them. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Memory validation now reports an error when a memory reference names a variable that is not defined, instead of silently accepting it. This catches typos and stale references at validation time rather than letting them fail later at runtime. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
The Hive struct and desk_policy helper were extracted from the desks example into a new hive module, and the validation identity calls were reformatted to satisfy rustfmt. No behaviour changes. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
The document module was no longer referenced anywhere in the crate, so it has been dropped to keep the source tree free of dead code. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
The document module was no longer referenced anywhere in the crate, so it has been dropped to keep the source tree free of dead code. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reworked the derive patch implementation to reduce duplication and make the control flow easier to follow. Behaviour is unchanged. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
…on is empty, and the stat is bl Could you paste the diff (or at least the stat and a summary of the change)? Once I can see the `+`/`-` lines I'll write the Conventional Commits message. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a README explaining the hive view example and how to run it, and extend the structure example so the documented behaviour matches what the code actually does. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds package fixtures used by the hive_view example tests so the example can exercise package handling without relying on external data. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Move the type checking logic out of the monolithic checker into its own module so the code is easier to navigate and extend. Behaviour is unchanged. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
The hive simulation now models referral links between agents, and the fake hive view exposes them so the viewer can render referral relationships. Tests cover the new referral behaviour. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Empty list literals were rejected during type checking because the element type could not be inferred from an empty sequence. They are now accepted, deferring element type resolution until the list is used. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a small script under the lab viewer tools that inspects the Hive state for the example, giving a quick way to verify the viewer's data without opening the UI. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Drop the stale module declaration from the language crate's module tree since nothing references it anymore. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add public check and diagnostic modules and re-export their types, including Review, Diagnostic, Rule, and the check, check_packages, and diagnose functions, so callers can run review checks and inspect diagnostics directly. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
The read-only memory check now collects a memory's bindings through a shared helper instead of a closure defined inline, and compares them by reference rather than cloning into temporary vectors. The unused body_offset re-export in the patch module was dropped. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
…refused Add a Checked type alias and an accepted helper that unwraps a review or renders its diagnostics as the test failure, then route the success-path assertions through it. Previously a refusal in these tests surfaced only as a bare error, hiding which rule fired. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Document the euler_hive test binary so its purpose and usage are clear to anyone browsing the examples directory. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The README described recordings as active within 10 minutes of their last change, but the viewer now uses a 20 minute window, so the documented threshold and the idle cutoff for streaming were corrected to match. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
…mind into hive-language-docs
Update the vendored openhuman submodule to the latest commit. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Pin tinychannels-bus and tinychannels-runtime back to 0.1.17 in the lockfile, reverting the 0.1.18 bump. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Merging main left Cargo.toml pinning 467ab703 while the gitlink stayed at 4739e97284. Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the locked versions of tinychannels-bus and tinychannels-runtime to 0.1.18 to match the new release. Auto-committed-on: macbook Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 133b215ee3
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d72e35ea3f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| run.frame(&Frame::Start { | ||
| package: lowered.id.clone(), | ||
| seed: 0, | ||
| seats: lowered.seats.len(), | ||
| problem: Some(ProblemFrame { | ||
| id: args.problem_id.clone(), | ||
| statement: statement.clone(), | ||
| answer: None, | ||
| }), | ||
| live: Some(true), | ||
| model: Some(args.model.clone()), | ||
| limits: serde_json::to_value(args.limits)?, | ||
| }); |
There was a problem hiding this comment.
Check initial recording writes before starting turns
When package.json or the start frame cannot be written—for example because the recording filesystem fills after RunDir::create succeeds—these calls only record the failure, and the first paid round still runs because run.check() is not reached until after that round. Fresh evidence beyond the prior per-round fix is that these initial writes remain unchecked before entering the execution loop; call run.check()? before opening the federation so a run with no durable start record issues no model calls.
AGENTS.md reference: AGENTS.md:L85-L87
Useful? React with 👍 / 👎.
| if let Ok(usage) = budget::openrouter_usage(&http, &openrouter_key).await { | ||
| budget.record_account(usage); | ||
| } |
There was a problem hiding this comment.
Bound usage polling by the remaining wall-clock budget
When less than the HTTP client's 20-second timeout remains and the OpenRouter usage endpoint is slow, this await occurs before admit_round checks the elapsed time, so --max-wall-seconds can be exceeded by the polling request even though no turn is admitted. Apply the remaining global deadline to this request, or check admission before awaiting it.
Useful? React with 👍 / 👎.
| } finally { | ||
| if (runAbort === ctl) player.finish(); | ||
| } |
There was a problem hiding this comment.
Clear the completed run controller
After a run finishes normally, this leaves runAbort pointing at its controller. While the same package remains open, ownRun therefore classifies every later recording for that package whose timestamp is newer than the old run as belonging to this page, so externally started live runs are permanently filtered out of auto-follow and toast notifications. Clear runAbort when this controller completes after finishing the player.
Useful? React with 👍 / 👎.
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
|
Latest pushed head: Merged upstream Fixed the paid-run local/origin gate, bounded custom math and referral turns, reserved model-loop capacity before launch, preserved superscript/subscript statement meaning, refused provider web models, required a current check for verified publication, and bounded closing memory reads. Runtime fixture tests are serialized because OpenHuman permits one runtime per process. Validation so far: root formatting, Clippy, build and all-feature tests passed; rustdoc passed; 78 viewer tests passed; all 44 Euler-host tests passed. Each newly fixed behavior had a failing regression before the fix. Full standalone workspace tests/Clippy and per-file coverage are running. Hosted checks on this new head are pending. Next: finish validation, reply to validated findings in their original threads, and keep following checks and new feedback until green and clean. The PR remains open. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9790c84a3a
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export const WATCH_MS = 1000; | ||
|
|
||
| /** What changes when a recording appears, grows, goes quiet or ends. */ | ||
| export const listingSignature = (list) => list.map((r) => `${r.id}:${r.size}:${r.mtime}:${r.live}:${r.ended}`).join("|"); |
There was a problem hiding this comment.
Include active state in the recording signature
When an unfinished recording remains unchanged, live flips to false after 30 seconds and active flips to false after 20 minutes, but this signature omits active. After the first transition is broadcast, the later scan has the same signature, so connected clients retain active: true and keep the crashed run in the “Live now” strip as QUIET indefinitely until an unrelated recording changes.
Useful? React with 👍 / 👎.
| let page = self.engine.list(ListRequest::new(filter, 50)).await?; | ||
| let mut hits: Vec<_> = page | ||
| .items | ||
| .into_iter() | ||
| .filter(|hit| hit.meta.agent_id.as_deref() != Some(self.binding.agent_id.as_str())) |
There was a problem hiding this comment.
Page past self-authored notes during rejoin
When a seat has at least 50 of its own newer entries in a shared reach such as the verified pool, this fetch limits the page before filtering out that seat's entries. Peer notes beyond that first page are omitted, yet the successful recall advances seen to the read's start time, so those older peer notes are permanently skipped on later rejoins; paginate until enough non-self entries are collected or exclude the current agent in the query.
Useful? React with 👍 / 👎.
Finish euler_hive and viewer review follow-ups from #126
Summary
This PR makes the hive language (
tinyhivemind-lang) something you can read about, look at, edit safely and run live. It also proves the language against two real Project Euler problems.Gallery. Eight example packages live under
crates/tinyhivemind-lang/examples/hives/:review-board,research-debate,incident-response,memory-guildandself-improving.math-panel, with 5 seats.math-swarm, with 50 seats on five desks of ten, connected by real cross-desk referral routing. Each seat has a distinct persona.euler-hive, with 14 seats on five desks: research, theory, compute, verify and synthesis. Only research seats may search the web, and only compute and verify seats may run Python.Direct edits with compiler-style checking. Orchestrators edit package files directly.
tinyhivemind_lang::check(original, edited)either reports every violated rule as aDiagnostic { file, pointer, rule, message }or returns aReview. TheReviewnames the edit classes touched and records them in lineage.docs/specs/hive-language-checking.md.hive_viewexample. It renders a package as a tree,--mermaidor--json. It can also:--run,--framesand--trace;--compare;--live --model --max-calls.Live mode denies web access in three places: in each package's tool deny list, in the request body, which carries no tools, plugins or web-search options, and by refusing model ids that contain
online,search,sonarorweb.--recordwritesstructure.jsonandframes.ndjsonto the gitignoredhive-runs/folder at the main checkout's root.Live UI in the existing Vite viewer (
examples/lab/viewer):euler_hiveOpenHuman host (examples/openhuman/src/bin/euler_hive*):run_pythonruns in a Docker container with no network and nothing mounted.CompletionDriver, and desks reach each other only through core's referral fold.OpenHuman bumped to
4739e97284. This includes OpenHuman #7385, which keeps secrets in memory, so embed hosts never touch the OS keychain.RuntimeConfig::runtime_pythonandServiceSet::harness_initare dropped.Docs.
tinyhivemind-lang.Results
Offline, 50 seeds, routed desks. The behaviour parameters were fixed before the first run and never tuned.
The swarm beats a single seat. The 5-seat panel does not: 28% of panel runs run out of budget after a wrong checker silences the correct advocates. These numbers come from a simulation with seeded per-seat accuracy, not from real models.
Live,
hive_view,openai/gpt-oss-120b:nitro.Live,
euler_hive,google/gemini-3.8-flash. Answers are kept out of this PR and the repo. They are scored against oracles that exist only in the gitignoredhive-runs/.no_decision.All runs together cost about $5.7 on OpenRouter plus $0.6 on search. The runs exposed five host defects, now fixed, each with a regression test:
Details are in
docs/experiments/2026-10-11-euler-hive-live.md, which has the problem data and answers redacted.Related issue
None.
API or behavior changes
All of these are additive:
tinyhivemind-langaddscheck,Diagnostic,RuleandReviewfor checking direct edits.validate_pathandvalidate_namespaceare re-exported at the crate root.The workspace now builds against OpenHuman
4739e97284and matching tinytools and tinymemory pins.Not changed:
Error::Frontmatter { seat }is also raised for role charters, so its field name is misleading. Renaming it would be a breaking change, so it is left as a follow-up.Validation
cargo fmt --all -- --check: ok.cargo clippy --all-targets --all-features -- -D warnings: the only errors are local rustc 1.96doc_markdownlints intinyhivemind-hives, a crate this PR leaves unchanged. CI's Clippy step passes them.cargo build --all-targets --all-features: ok.cargo test --all-features: all pass, run after the OpenHuman bump..github/scripts/assert-pure.sh: clean. The script itself is unchanged..github/scripts/assert-openhuman-pin.sh: all six pins match.cargo clippy --manifest-path examples/openhuman/Cargo.toml --all-targets -- -D warningsandcargo test --manifest-path examples/openhuman/Cargo.toml: all pass, including the 32euler_hivetests.examples/lab/viewer:npm testpasses all 75 tests, and the headlesstools/hive-check.mjspasses.Note: CI on
mainalready fails the per-file coverage gate oncrates/tinyhivemind-openhuman/src/deploy/test/hook_composition.rs(87%). This PR doesn't touch that file.The
--max-model-callscap ineuler_hiveis checked between rounds, so one round can go over it. Spend and wall time remain hard caps. An exact model-call cap needs a hook inside the agent loop, so it is a follow-up; the review thread explains this.Tests
tests/gallery_packages.rs:tests/direct_edits.rs:checkdiagnostics for every rule, the edit classes it infers, and the lineage it records.tests/euler_hive_package.rs.hive_viewtests (test = true): the loader, mermaid output, convergence, the frame serde forms, compare, routing, the live provider (capped and never retried), recording names, and the turn budget split.euler_hive: 32 offline tests. They cover the sandbox flags, budgets, referrals, floors, memory, the search guard, and request bodies carrying exactly each seat's allowed tools.Documentation
docs/specs/hive-language.md,hive-language-checking.mdandopenhuman-hive-config.md.docs/adr/0033.docs/experiments/2026-10-11-math-hive-scale.mdand2026-10-11-euler-hive-live.md.hive_view,euler_hiveand the viewer.Checklist
#[allow(...)]or#[ignore], and no relaxed lints..envcontents or Project Euler answers in the diff or the description..env.exampleholds placeholders only.