Skip to content

feat: give the core a board record and the hide board command - #3

Merged
HyunjunJeon merged 9 commits into
mainfrom
feat/board-record
Nov 13, 2026
Merged

HyunjunJeon merged 9 commits into
mainfrom
feat/board-record

Conversation

@HyunjunJeon

@HyunjunJeon HyunjunJeon commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Related: mission-6 node record (boards in Hide itself); nodes view and hide-ai build on it.

Summary

An agent had no way to show the operator something with parts (an explanation, a table, quoted code, a diagram, a decision) that stays current after the operator looked: a file View reads its file once.
This gives Hide's core a board record of its own: hide board new|set|edit|show|list|delete draws a board for the agent's native session, changes it block by block, and keeps it in state/boards/, outside every other store.
No View yet: new only creates the record, and its answer carries no view.

What nodes view and hide-ai build on (public names in hide_core::boards):

  • Model: Board (id, owner, checkout, title, blocks, next_block, revision, times, flattened state), Block (id, changed_at, flattened Body), Body (section|callout|table|code|quote|diagram|divider, kind()), Tone, BoardState (name(): open|kept|deleted), Remover, BoardCheckout.
  • Export: block_markdown(&Body) for one block and markdown(&Board) for a whole board, as design section 4 and its "Optional titles and notes" say; summary(&Board) is the answer line.
  • Read-only book: inside the runtime, self.boards.boards() iterates every board (deleted stubs and kept ones included) and self.boards.get(id) finds one; nothing else of the book is reachable.
  • CLI replies, one JSON line each: a change answers {"ok":true,"result":{"board":{"id","title","revision","state","blocks":[{"id","type"}]}}}; show <board> adds "markdown"; show --json answers {"board":<record>}; list and a bare show answer {"boards":[...]}; a refusal answers {"ok":false,"reason","next_action"}, the field to fix in parentheses at the end of next_action.
  • boards.rs holds a quote's path to suggestions::investigation::reads::readable_path (and its READ_PATH_CHARS), so node hide-ai keeps that function and its meaning: changing it changes what a board may quote.

No screenshot: the only site change is seven CLI reference notes, which the docs check generates as text; no page or component changes.

Review

  • Decide: set keeps a block's id when the block names it ("id": "b3"); without it every set renumbers the board. (Judged sound in review.)
  • Decide: a quote's path follows the investigation's readable_path, 240 characters at most, so every quoted path is one Hide AI may read. (Judged sound in review.)
  • Decide: insert and move without after put the block last, as the reference model does, so no edit puts a block first; set does. Kept: a first-place form ("after": null or a before) would be a second spelling of one place for every agent to learn.
  • Decide: a board file that cannot be decoded stays on disk outside the book and is logged (boards.file_unreadable); its id is never given again. Kept: it may be a newer build's board, and this build never writes over or deletes what it cannot read. A file the index let go is removed.
  • Risky files: hide-core/src/runtime/boards.rs - each command runs under Mutex<Runtime>: it checks the board and serializes it once to hold it to 64 KiB; a show copies its boards there and draws their Markdown after the lock is released (BoardTurn); no file I/O there.
  • Risky files: hide-core/src/board_store.rs - the save thread and the read at creation: a body file is the authority unless the index let it go; a failed write or delete is kept for the next save (a newer one wins) and tried once more on drop; an index of another schema keeps every command out rather than being written over.
  • Risky files: hide-core/src/node_migration{.rs,/reown.rs,/devices.rs} - board files are rekeyed by new KEYS rows on a core move and a device's new id, as mission files are; the index names no machine.
  • Risky files: hided/src/server.rs - ScopedRequest::Board needs no shell and takes the full frame, like a plan.
  • Risky files: hided/src/board_cli.rs - the quote guard: a path is refused before any read unless it is a readable path, and a link that leads out of the checkout or to a credential is refused after it is resolved; the file is read to its 1 MiB cap and no further.
  • Risky files: scripts/install-agent-clis.py - a gate fix: it read contracts/agent-adapters.json, contracts/agent-journey.json and the downloaded SHA256SUMS.txt with the system's default encoding, and Windows' cp1252 cannot decode the prompt mark U+276F already on main; this pull request runs that lane because it changes the lane plan (scripts/ci-plan.py), so all three reads name UTF-8, and scripts/tests/test_agent_clis.py reads the contracts as a cp1252 system would (without the encoding it fails with the lane's own error).
  • Cost: no resident work: no timer, watcher or worker that runs on its own. One save thread starts when a command changed a board, holds at most one pending body per board (book capped at 256) and ends when the queue is empty; a refused or unchanged command saves and publishes nothing.

Tests

  • Layer: unit (boards::tests, board_store::tests, board_cli::tests), core runtime (runtime::tests::boards, 14 tests on the delivery fixture's two agent panes), node_migration (core move, device rename), and one e2e.
  • Layer: the e2e (web/e2e/board.spec.ts) protects the agent's journey through the real CLI: the pane capability, the hook route that names the checkout for a quote read, the daemon's refusal detail. A core test cannot see the CLI read a quote or the daemon split a refusal.
  • Catches (each planted and reverted): may_read always true, or its ancestor clause removed, fails only a_parent_reads_a_board_its_child_drew_in_another_checkout_and_no_one_else_does, whose sessions are keyed as production keys them (the row's native session; the ledger's native session beside the actor's digest).
  • Catches: an open board of a session on screen ranked evictable fails both eviction tests; a failed write dropped instead of kept fails a_failed_write_is_written_again_with_the_next_save and a_failed_delete_is_done_again_and_its_board_never_comes_back; dropping the owner check fails only_the_session_that_drew_a_board_changes_it.
  • Catches: c3, a_saved_board_leaves_the_link_record_at_16_and_the_view_layouts_at_5, reads PRAGMA user_version of a link record the worker made and the saved workspace-views.json after a board is on disk.
  • Repeat: the board filter of hide-core (75 tests: model, store, runtime, node_migration board cases) x 10 runs, all green, and the e2e --repeat-each=3, 3 of 3, locally at 284bcfd39; this pull request's verify run also has the fork's repeat lane.
  • Waits: board.spec.ts sets a 120 s test budget, annotated: two agent stand-ins start and report their sessions (agentPane allows each 20 s). The Rust tests wait with wait_for on a board file's revision, a deleted file and the link record's schema, or join the save thread; no sleep.

Evidence

  • Verified: the mission's check at d953f9693, exit 0: verify-cargo.sh lint clean, 8520 Rust tests passed and 0 failed, web unit 2970 and desktop unit 325 passed (macOS). Two earlier runs at the same head each failed one test this change does not touch, which passed 5 of 5 alone: runtime::tests::missions::one_cause_on_five_nodes_shows_the_operator_one_card_at_most (it reads the clock once and asserts a raise 19 minutes back against a 20-minute threshold) and hide-node an_install_sends_only_what_the_device_does_not_hold_whole (a child ended with a broken pipe).
  • Verified: at 284bcfd39: verify-cargo.sh test-scoped -p hide-core --lib board: 75 passed; node_migration::: 70 passed; -p hided --lib -- board_cli:: cli_contract::: 12 passed; verify-cargo.sh lint: clean.
  • Verified: after verify-cargo.sh cli and pnpm --dir web build, pnpm --dir web exec playwright test e2e/board.spec.ts --repeat-each=3: 3 passed on an isolated daemon (macOS).
  • Verified: python3 scripts/check-core-touches-no-machine.py, check-timed-waits.py, check-no-attribution.py, check-no-workstation-identity.sh: clean; scripts/tests test_ci_plan.py (97) and test_core_touches_no_machine.py (8): OK.
  • Verified: the run for 284bcfd39 (43185635239) passed 49 jobs; it failed only agent CLIs (windows), on the encoding fixed here, and four macOS jobs no hosted runner picked up. The run for d953f9693 (43228925112) records the mission's ci line.
  • Not verified: Windows and Linux on a workstation: they are covered only by this pull request's verify run on the fork; nothing here is written for one system, and the store, the pane capability and the quote read go through hide_platform and the existing capability.
  • Not verified: a connected device: the quote read runs where the CLI runs, on the device, and the request takes the plan's route over the pane capability; the remote lanes that prove that route run only upstream.
  • Not verified: a release-written state folder: no release writes boards yet; scripts/release_state/scenario.py now has the step, so the first release that ships boards adds the folder, and until then the rekey is tested with hand fixtures (board_files_follow_the_core_owner, board_files_follow_a_device_rename).
  • Not verified: the private design documents: with-hide/hide-private cannot be opened from this fork. No private document owns boards today, and this change touches no behavior one of them owns (plans, missions, the session record), so no paired pull request is named.
How to run the journey

From the worktree, with no HIDE_* variable set (the mission's run.sh clears them):

bash scripts/verify-cargo.sh cli
pnpm --dir web build
pnpm --dir web exec playwright test e2e/board.spec.ts
bash scripts/verify-cargo.sh test-scoped -p hide-core --lib runtime::tests::boards::

A board is a record the core keeps for the native session that drew it,
as a plan is: a title and blocks (section, callout, table, code, quote,
diagram, divider), checked with the failing field named, changed by five
edit operations applied all or none, and exported as one Markdown text.

Boards live in a folder of their own under the state folder, one file
per board beside an index. The runtime reads the folder when it is made,
and one save thread with one pending body per board keeps it, so
links.sqlite3 and workspace-views.json keep their schemas. A session's
deleted or pruned records take its boards, and a core move or a
device's new id rekeys each board's file as it does a mission's.
hide board new, set, edit, show, list and delete reach the core through
the pane capability a plan uses, with no shell open. The command reads a
quote's lines from the caller's checkout on the machine that holds the
file, and refuses a quote that leaves the checkout or names a credential
before anything is sent. A refusal names the field to fix in its next
action. The CLI contract and the CLI reference gain the board topic, the
guides gain a Session boards section, and the first test of board.spec.ts
runs the journey as an agent in its own pane.
…path rule

The board's quote guard called its own copy of the rule the suggestion
investigation reads by; it now asks that rule, so every path a board
quotes is one Hide AI may read, and a move refused partway no longer
puts its block back in a draft the refusal drops.
… oldest stub go

The read a mission's Conductor relies on, a board drawn by its worker in
the worker's own worktree, had no test: it now runs with the sessions
keyed as production keys them (the row's native session, the ledger's
native session beside the actor's digest). A full book's eviction is
tested too, and boards updated in the same millisecond go in the order
they were drawn.
…tory checks

The board store is one of the core's own stores, so the machine-touch
check lists it with its five touches and why; the board command's usage
is help text the user docs lane reads; and the release-state scenario
has an agent on the core and one on the device draw a board, which a
release before boards records as not done.
…e lock

A board body or delete that failed on disk was dropped while the index
went on without it, so a failed delete brought the board back after a
restart. The writer now keeps what failed for the next save unless a
newer one of that board came first, tries it once more when it is
dropped, and a start removes a file the index already let go.

A show copies the boards it prints under the lock and draws their
Markdown after it. The quote read stops at its cap, a --json document
may span lines, and the quote path rule names its length limit from
the investigation's own constant.

Tests now pin who reads a board (a parent in another checkout, nobody
else, never a child reading up), the eviction order past the cap, the
archive delete taking a session's boards, and that the command refuses
a credential quote before reading anything.
# Conflicts:
#	contracts/hide-cli.json
install-agent-clis.py read contracts/agent-adapters.json and
contracts/agent-journey.json with the system's default encoding, so on
Windows (cp1252) the prompt mark U+276F in agent-adapters.json stopped
the agent CLIs lane. This pull request runs that lane because it changes
the lane plan; both repository files are now read as UTF-8.
…ng the agent CLIs

The installer's reads of its text files name UTF-8, the downloaded
SHA256SUMS.txt included, and a test reads the two contracts with the
system default set to cp1252, as a Windows runner has it: without the
encoding it fails with the error the Windows agent CLIs lane showed.
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.

1 participant