Skip to content

[CTX-0331] docs(security): record the V-26 replaced-inode and symlink tamper variants and the AC-022 live ctl cells - #526

Merged
Xuepoo merged 2 commits into
mainfrom
ctx-0331/v26-tamper-variants
Nov 22, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
ctx-0331/v26-tamper-variants

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Related bitty-terminal/bitty#2921

Evidence lane for the bittyd P0 acceptance criteria (CTX-0331): two dated
records at bitty origin/main 48f297d99aba65a96530f4ce028567e082a402d3
(detached clone, porcelain empty before and after every run; the shared
workspace checkout stayed read-only), docs and evidence only, no criterion
flipped.

What the records supply

bittyd V-26 Tamper Variants 2026-11-22
constructs the two same-uid variants of the V-26 endpoint-tamper exit that
every prior record left unrun:

  • replaced-inode: the bound socket renamed away, a plain file planted at
    the socket path — daemon observed serving over the real endpoint first
    (daemon.negotiate ok, daemon.status running, tcp_listeners=0),
    then fail-closed exit 6 at 5.26 s, the single tamper line
    bittyd: endpoint tamper; no weaker transport is attempted on stderr,
    stdout empty;
  • symlink: the path replaced by a symlink pointing at the renamed live
    socket — same served-first observation, same exit 6 at 5.26 s, same
    single line;
  • recorded exactly as observed and differing from the 2026-11-21 mode
    variant: the socket path is not removed on either exit, because the
    shutdown identity check refuses to unlink an object the daemon did not
    bind — the planted artifact and the renamed socket file survive while
    refusing connections;
  • the owner-change variant stays a declared typed skip (needs privilege;
    this host has no passwordless sudo; never attempted), and V-26's
    harness row keeps its requires-tamper-seam typed skip.

bittyd AC-022 Live Ctl Cells 2026-11-22
drives the terminal-instance verbs the 2026-11-16 record left unexercised,
live against a served bitty --test-mode instance over its socket:

  • ctl terminal send — allowed under the CLI default grant, exit 0, the
    untrusted-output notice carried;
  • ctl terminal text — allowed, exit 0, with the line sent by the previous
    verb observable in the read-back grid, so the allow rows are not vacuous;
  • scope-gate control on the same connection class: ctl terminal spawn
    denied exit 7 Denied/ScopeDenied naming terminal.manage;
  • ctl window new recorded exactly as the headless servo answers it (the
    view.manage gate passed, the request offered into the bounded lane, exit
    6 Unavailable, nothing created) — the app-threaded allow cell stays a
    typed skip: it needs a windowed instance, the host compositor is out of
    scope by the workspace GUI-testing ban, and no nested/virtual display
    backend exists on the host;
  • the mechanism note that terminal send/terminal text ride
    ScopeSet::cli_default() and union-only elevation
    (ipc_serve.rs ConnectionServices::from_process_env), so no CLI-shaped
    live deny arm exists for them at this revision.

Build identity

  • bitty at 48f297d9, workspace version 0.0.47, bitty-ipc pin
    18a1432.
  • Frozen bitty#2605 conformance driver green at the head in both recipe
    forms: plain 68 pass / 18 skip / 0 fail of 86, recipe (test-seams)
    70 pass / 16 skip / 0 fail, V-44 served through the seam, parity 48
    compared, 0 divergences.
  • bittyd (plain form, the binary every out-of-harness cell ran, hash
    verified before and after the campaign): 37734752 bytes, SHA-256
    3ce1b84dadc5bd0f6951368e3f21ef3d00936b9a3875e48a9c11d994afc2ca6a;
    bittyd 0.0.47 (service API 1.5).
  • bittyd (test-seams recipe build, test-only): 37780960 bytes, SHA-256
    802b9dbd0224fa5839ffe992f6cd9028da643b4059e43cf00ba514d65f0fbfd3.
  • bitty terminal binary: 612811784 bytes, SHA-256
    61572b6aa0942d41b9f4e4c62c56251d2938a58fde490b8b9bca2bf714b05c50;
    bitty 0.0.47 (dev 48f297d9).

Cells moved (record-dont-flip; no status changed)

  • p0-acceptance-criteria.md: P0-AC-021 evidence + residual cells (the two
    constructed variants added; the owner-change variant kept), P0-AC-022
    evidence + residual cells (the live send/text verbs added; the
    app-threaded window-new cell kept as a typed skip), and the campaign-status
    introduction.
  • evidence-matrix.md: a new 2026-11-22 V-26 tamper-variant and AC-022 live-ctl campaign subsection; the DR-02 intake note; the P0-AC-021
    residual cell of the 2026-11-21 campaign table; the P0-AC-022 residual
    cell of the 2026-11-16 campaign table; the P0-AC-022 residual-cells
    bullet.
  • risk-register.md: the DR-02 row gains the recorded-run note (mode
    variant at 0bdb6d1c, replaced-inode + symlink at 48f297d9) and keeps
    Open, mirroring the paragraph the 2026-11-21 record added to DR-08.

Every State column is unchanged: R-011 and DR-02 stay Open,
P0-AC-021/P0-AC-022 stay Partially verified, nothing is marked Verified,
and the independent review stays owed.

Process notes

  • Only PIDs the records started were touched: the two tamper daemons ended
    by their own exit 6, the test-mode instance by a signal to its recorded
    pid (the repo fixture's own teardown pattern); the owner's live daemon row
    was listed before and after each campaign, unchanged; no pattern kills,
    no sudo, no TCP, no display server.
  • just check is green (prettier, markdownlint, language, agents, hygiene,
    state, actionlint). Prettier realigned the existing table rows around the
    edited cells — the re-padding is the gate's own formatting, not a rewrite.

… tamper variants and the AC-022 live ctl cells

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Independent review of PR #526 ([CTX-0331] docs(security): record the V-26 replaced-inode and symlink tamper variants and the AC-022 live ctl cells) — head 37ccab55e1902af5095225f487c696fb494ce644 (confirmed via git ls-remote at review start), base origin/main 9c2f4b8. Mechanism claims were cross-checked against the bitty source at origin/main 48f297d9; corpus conventions were compared against the 2026-11-21 record. All eight numbered checks executed; status/State cells were compared cell-by-cell programmatically between origin/main and the head, not by eye.

  1. PASS — RECORD-DONT-FLIP. No status or State column flipped: P0-AC-021 stays Verified (Linux x86_64) / Partially verified (docs/security/p0-acceptance-criteria.md:807), P0-AC-022 stays Partially verified / Partially verified (:808), rows P0-AC-023..026 identical after whitespace normalization (prettier re-padding only); DR-02 stays Open (docs/security/risk-register.md:191, State verified unchanged for every DR and R row); evidence-matrix DR-02 stays Open (docs/security/evidence-matrix.md:187). The content diff touches only evidence + residual cells: p0-acceptance-criteria rows 021/022 evidence+residual columns plus the campaign-status intro (:796-802); risk-register DR-02 mitigation/exit-evidence cell (:191); evidence-matrix DR-02 remaining-gap cell (:187), the residual cells of the 2026-11-16/2026-11-21 campaign rows, the residual bullets, and the new 2026-11-22 subsection (:542). One line: no criterion or risk moved, evidence cells only.

  2. PASS — HONEST DIVERGENCE. The record states the non-removal as observed behavior and does not editorialize it into compliance: bittyd-v26-variants-2026-11-22.md:36-44 ("recorded exactly as observed … the socket path is not removed on the way out"), :204-208 (the shutdown identity check), :256-261 ("The socket path is not claimed removed"), explicitly contrasted with the 2026-11-21 chmod variant's removed path (:38-39; bittyd-frozen-vector-runs-2026-11-21.md:180, :291-293). Mechanism confirmed in bitty at 48f297d9: remove_owned_socket (crates/bitty-daemon/src/endpoint.rs:617-649) reads the path with symlink_metadata, refuses a symlink (TamperKind::Symlink), and refuses the unlink when observed dev/ino/uid identity differs from the bound identity (TamperKind::Replaced, "nothing is unlinked in that case") — so the planted plain file and the symlink both survive shutdown; BoundEndpoint::reattest (endpoint.rs:586-598) re-stats via symlink_metadata, so a symlink fails before the target is ever consulted and attest_socket_metadata/attest_existing_socket (endpoint.rs:958) fails a plain file on the socket-type check before mode or owner; TAMPER_INTERVAL_MS = 5_000 (crates/bitty-daemon/src/service/server.rs:72) matches the recorded 5.26 s; the single tamper line is verbatim (crates/bitty-daemon/src/cli.rs:274); server.rs:867 drives the re-attestation exit. The chmod variant still removed its path because the identity check passed there — the recorded divergence is real, observed, and honestly framed.

  3. PASS — OBSERVED-FIRST DISCIPLINE. Both tamper variants observe the endpoint serving over the real transport before the tamper, matching the 2026-11-21 construction: replaced-inode — srw------- (600) stat, daemon.negotiate ok endpoint_kind=unix_socket, daemon.status running tcp_listeners=0 active_sessions=0 (bittyd-v26-variants-2026-11-22.md:162 cell row, :175-181 transcript), then the tamper, then exit 6 at 5.26 s (:185-187); symlink — the same served-first observation on a second isolated daemon with its own 32-hex daemon_instance_id (:163, :218-220), exit 6 at 5.26 s (:224-226). Exit codes and timings are recorded per run; the companion live-ctl record records exit codes per cell (rc=0/0/6/7, bittyd-ac022-live-ctl-2026-11-22.md:129-142).

  4. PASS — AC-022 LIVE CELLS. The terminal send/text allow rows are not vacuous: the terminal text read-back grid carries the exact line cell 1 sent (sh-5.3$ echo ctx-0331-terminal-send) — bittyd-ac022-live-ctl-2026-11-22.md:118 (cell table), :132 (transcript), :145-148 ("the allow row is not a vacuous ok"). The window-new row is recorded exactly as the record text the check requires: the headless servo's exit 6 Unavailable refusal "recorded as observed, not as the allow cell" (:119), and the allow cell is declared a typed skip — it needs a windowed instance, the host compositor is out of scope by the GUI-testing ban, and no nested/virtual display exists on the host (:26-36, :172-186, :190-192, :214-216). Mechanism corroborated in source: bitty.debug/spawnTerminal requires terminal.manage (bitty-ipc 18a1432, crates/bitty-ipc-devtools/src/ctl.rs:29, :796); the Unserviced message is verbatim (crates/bitty-terminal/src/ctl/new_window.rs:118); the exit mapping is Denied=7 / Unavailable=6 (crates/bitty-terminal/src/cmd.rs:29, src/ctl.rs:63, src/ctl/render.rs:81); ScopeSet::cli_default() holds exactly the six scopes the record quotes (bitty-ipc crates/bitty-ipc-api/src/scope.rs:271) and elevation_from_env is union-only — it starts from the CLI default and only inserts (crates/bitty-ipc-devtools/src/ctl.rs:2565), via ConnectionServices::from_process_env read once at listener start (crates/bitty-terminal/src/ipc_serve.rs:918) — so the record's claim that no CLI-shaped live deny arm exists for these verbs at this revision is source-accurate.

  5. FAIL — BUILD IDENTITY. The pinning half passes: bitty SHA 48f297d9 pinned (bittyd-v26-variants-2026-11-22.md:81; bittyd-ac022-live-ctl-2026-11-22.md:83); binary SHA-256 digests recorded (bittyd plain 3ce1b84d… v26:96-97, test-seams 802b9dbd… v26:102-103, bitty terminal 61572b6a… v26:117-118 and ac022:88-89); and which binary ran which cells is stated (v26:99-100 "every out-of-harness cell ran against it", v26:104-106 the test-seams build "is not the binary the cells below ran", ac022:86-87 "the terminal binary for these cells"). But the discarded git-archive build with the wrong embedded revision is NOT disclosed: zero occurrences of "archive" in both new records, evidence-matrix.md, p0-acceptance-criteria.md, and risk-register.md (per-file grep count 0); nothing in the PR body's Build identity section; the PR has zero comments and zero reviews; the commit message is title-only; and the carryctx CTX-0331 notes, events, decisions, and handoffs contain no mention. The records state only the final driver-built/detached-clone path with the correct (dev 48f297d9). FAIL-unverified: the required disclosure could not be found anywhere in the PR. Fix: add a build-history sentence to the records' Source identity sections naming the discarded git-archive build and its wrong embedded revision (or state that no archive build was attempted), then re-run the gates.

  6. PASS — CORPUS CONVENTIONS. Both records match the 2026-11-21 record's structure: same frontmatter schema with sequential sidebar_order 65/66 (bittyd-v26-variants-2026-11-22.md:1-10, bittyd-ac022-live-ctl-2026-11-22.md:1-10 vs bittyd-frozen-vector-runs-2026-11-21.md:1-10), dated titles (:12), "Status: dated evidence record; independent review pending." (:14), Purpose with In/Out of scope, Source identity, Isolation and safety, a per-run cell table with Command + Observed columns and full ```sh transcripts, "What this record does not claim", "Effect on the evidence matrix", "Residual blockers", References. Typed skips declared: owner-change (v26:71-73, :252-255, :291-293), second-uid/V-25 (:76, :294-295), Windows/`V-27` (:76, :296-297; ac022:75, :222). No hardcoded host usernames or host-specific absolute paths: grep for `fuyu|/home/|/mnt/data` = 0 hits in both new records; transcripts are written `/run-…/…` (v26:143-144), matching the 2026-11-21 phrasing `/runN/…` (frozen-vector:158-159); the host line carries `uid `1000`` with no username (v26:120-121, ac022:96), matching frozen-vector:131. The risk-register `DR-02` note (:191) follows the `DR-08` pattern (:197): a recorded-run note ending "the row stays `Open` because … the independent review is still owed".

  7. PASS — CROSS-REFERENCE FORM. The PR body opens with Related bitty-terminal/bitty#2921 — the full cross-repo form, not a dangling bare #2921 (body line 1); grep for closes|fixes|resolves over the body returns no matches — no Closes claim.

  8. PASS — GATES. just check in the lane worktree with the real bun first on PATH ($HOME/.local/share/bun/bin, bun 1.4.5, bun --version rc=0): rc=0. Per-gate: fmt-check ok; markdownlint 0 issues in 137 files; links ok; docs-check-cross-repo PASS (1095 links, dead 0, 1 skipped); metadata, language, agents, hygiene all validated; svg skip (bitty-terminal docs submodule not initialized — a pre-existing checkout condition, not content); state snapshot validated; actionlint ok. No bun-shim rc=139 was encountered at any point, no gate was weakened, and the worktree was clean (git status --porcelain empty) with HEAD unchanged after the run.

Summary: 7 of 8 checks PASS — the records are honest about the divergence (source-confirmed down to the unlink identity check), structurally conformant to the corpus, flip nothing, and the gates are green. Check 5 FAILs on one element only: the discarded git-archive build (wrong embedded revision) is not disclosed anywhere in the PR. That is a one-paragraph disclosure fix in the records' Source identity sections plus a gates re-run; everything else in this lane is approve-ready.

VERDICT: CHANGES-REQUESTED

…build in both records

Review finding on PR #526: the two records pinned the clean-clone build
identity but did not disclose the discarded first build whose embedded
revision read a walk-up repository (f0ee8c5). Both Source identity
sections now carry the build-history disclosure; no cell, hash, or row
came from the discarded tree. Record-dont-flip unchanged.

@Xuepoo Xuepoo left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Delta re-review of PR #526 ([CTX-0331] docs(security): record the V-26 replaced-inode and symlink tamper variants and the AC-022 live ctl cells) — fix round at head 698acf837009ae585379717d8018556a138dc901 (remote branch head, gh pr view --json headRefOid, and the lane worktree HEAD all agree; worktree clean). This is a delta re-review of the fix round against the original CHANGES-REQUESTED at 37ccab55e1902af5095225f487c696fb494ce644, whose single failing check was #5 (build identity: the discarded git-archive build with the wrong embedded revision was disclosed nowhere in the PR). Reviewer independent of both the original implementer and the fixer; the worktree was treated read-only — no merge, no branch update, no push.

  1. PASS — FIX SCOPE. git diff --name-status 37ccab55..698acf83 touches exactly the two audit records and nothing else: docs/security/audits/bittyd-v26-variants-2026-11-22.md and docs/security/audits/bittyd-ac022-live-ctl-2026-11-22.md (both M). The entire fix-round diff is additive inside the two Source identity bullet lists — +7 lines at bittyd-v26-variants-2026-11-22.md:87-93 (hunk @@ -84,6 +84,13 @@, inside ## Source identity :79) and +4 lines at bittyd-ac022-live-ctl-2026-11-22.md:86-89 (hunk @@ -83,6 +83,10 @@, inside ## Source identity :78); zero deleted or rewritten lines, so no other cell, row, status, or status-adjacent text changed. record-dont-flip intact: git diff 37ccab55 698acf83 over docs/security/p0-acceptance-criteria.md, docs/security/evidence-matrix.md, and docs/security/risk-register.md is empty (byte-identical to the reviewed round), and the criteria+matrix diff vs origin/main is byte-identical between rounds (146 lines, sha256 fdb6f5c7a98f5bbfba1c03f88ac39997f3c285f800679a7f00db6b8b2d454d3e at both heads), so the cells the original review verified keep those exact values: P0-AC-021 stays Partially verified (p0-acceptance-criteria.md:807), P0-AC-022 stays Partially verified (:808), DR-02 stays Open (risk-register.md:191, evidence-matrix.md:187).

  2. PASS — DISCLOSURE CONTENT. The v26 record's new bullet (bittyd-v26-variants-2026-11-22.md:87-93) states every fact the original check 5 demanded: the discarded export-based first build ("an earlier export-based source tree (a git archive snapshot of the same revision) was discarded", :87-88), the wrong embedded revision against the pin ("its embedded build revision read a walk-up repository and reported f0ee8c5, not the pinned 48f297d9…", :89-90 — the pinned SHA 48f297d99aba65a96530f4ce028567e082a402d3 is at :81), the catch timing ("discarded before any recorded cell ran", :88-89), and non-contamination ("Every observation below ran against the clean clone build described above; no cell, hash, or row in this record came from the discarded tree", :91-93). The ac022 record carries the companion pointer with the same facts (bittyd-ac022-live-ctl-2026-11-22.md:86-89): "The build history is the companion record's, including its disclosed and discarded export-based first build (embedded revision f0ee8c5, caught before any recorded cell ran in either record); no cell in this record came from that discarded tree." Honest assessment: this fully resolves the original check-5 FAIL. The prescription was a build-history disclosure in the records' Source identity sections naming the discarded git-archive build and its wrong embedded revision — both Source identity sections now carry it (the archive token the original review's grep counted at zero now sits at bittyd-v26-variants-2026-11-22.md:88, with the ac022 record pointing at the companion's full form), plus the gates re-run the same prescription asked for.

  3. PASS — NO NEW DEFECTS. No hardcoded host paths or usernames in the new text: grep -nE 'fuyu|/home/|/mnt/data' over both records returns zero hits, and the new bullets name no path beyond the generic "read a walk-up repository". The voice matches the corpus records — a disclosure-first bullet in the Source identity list, backticked revisions, the operative fact bolded, no editorializing — the same register the 2026-11-21 frozen-vector record established for build-identity wrinkles. No claim the diff cannot support: the discard is attributed exactly to the embedded revision string ("the embedded revision string is how the discard was caught", bittyd-v26-variants-2026-11-22.md:90-91), never to a hash verification of the discarded tree — no hash of the discarded build is claimed anywhere — and "Every observation below ran against the clean clone build described above" stays consistent with the pre-existing clean-clone bullet at :81-86.

  4. PASS — GATES. Local: just check in the lane worktree with the real bun first on PATH ($HOME/.local/share/bun/bin, bun 1.4.5): rc=0 — fmt-check ok (prettier 3.9.6), markdownlint 0 issues in 137 files, links ok, cross-repo PASS (144 resolved / 0 dead / 1 skipped), metadata, language, agents, hygiene validated, state snapshot validated, actionlint ok; svg skipped for the uninitialized bitty-terminal docs submodule — the same pre-existing checkout condition the original review recorded, not a content failure. Remote on the new head: gh pr checks 526 — 4 pass / 0 fail / 0 pending (Docs quality ×2, Secret scan ×2), rc=0. Worktree HEAD unchanged and clean after the run.

The fix round did exactly what the original review prescribed and nothing more: the one failing check's disclosure landed in both Source identity sections with no collateral edit, no new defect, and the gates green locally and remotely.

VERDICT: APPROVE

@Xuepoo
Xuepoo merged commit 2ba0a61 into main Nov 22, 2026
4 checks passed
@Xuepoo
Xuepoo deleted the ctx-0331/v26-tamper-variants branch November 22, 2026 01:14
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