Skip to content

Amendment 14 act 2: lanes-index (sync / reconcile / status), the detached post-write nudge, --index on lanes and history, the versioned schema with the owner column, and the offline-no-read / poisoned-index / wiped-reconcile tests #160

Description

@brettheap

Governing issue for Amendment 14's adoption act 2 — the tooling — under the amendment ratified by Brett Heap on 2026-10-05 ("ratify 48"; brettheap/new-workstation#48): the register's truth stays where it is; Postgres — or SQLite — becomes a DERIVED, NON-GATING index of it, written behind the sources, read only by tooling that decides nothing.

What lands here (clause (g)2)

  • lanes-index on PATH, placed by openRepoTools --install: sync (the write-behind upsert of what LANDED in a source), reconcile [--source <s>] [--dry-run] (rebuild a wiped or diverged index from the sources; never writes back), status (per source: store, provenance against the tip, lag, last error).
  • The post-write nudge in lanes-edit.sh's commit_push: after the push has landed and the mutex is released, a DETACHED lanes-index sync (stdin closed, never waited, status never read; skipped where lanes-index is absent or LANES_INDEX=off). It carries no data; the indexer reads origin/main as the push left it.
  • --index on lanes and on lanes-edit.sh history, typed per invocation, never from environment or configuration; each says on stderr read: index (<store>) at register@<sha12>; <k> commits behind or read: sources (index <why>) and exits as the source read would. history across lanes (--all, --repo <r>) — the sources without the flag.
  • The store per clause (c): QA Postgres where ${XDG_CONFIG_HOME:-$HOME/.config}/openRepoTools/lanes-index.conf (0600; or LANES_INDEX_CONFIG) names a url= with a passfile=; otherwise lanes-index.sqlite under ${XDG_STATE_HOME:-$HOME/.local/state}/openRepoTools/, never inside a git work tree. Refuse a group/world-readable config, a config inside a work tree, or a url= carrying a password. Two roles: a schema-scoped WRITER (the indexer only) and a SELECT-only READER.
  • The versioned schema of clause (e): lanes (with owner = legacy / managed <owner> / unknown, read from managed-projection's 0/8/1 — never a parser of the indexer's), log_lines (file ordinal; unreadable rows kept), register_lines (LANDING/LANDED/HOLD/HOLD RELEASED), holds as a VIEW in file order, transcript_pointers; the ledger half's tables are T058's to fill (ledger:<Workstation> source).
  • Upserts keyed by (source, record id), versioned by content digest; provenance (register commit sha / ledger generation; UTC indexed; schema version) that only moves forward, compare-and-swapped in the same transaction as the rows.
  • docs/README-lanes.md: a "The derived index" section.

Tests (the amendment names them)

  • offline no-read: every act's existing case byte-identical with the index unreachable;
  • poisoned index: an index with WRONG rows changes no act's answer — the proof that acts do not read it;
  • wiped-index reconcile: the rebuild equals a synced index row for row;
  • replay: a repeated sync changes nothing;
  • monotonic provenance: a sync from a non-descendant commit writes nothing;
  • a hung indexer delays no writer beyond the fork;
  • the managed seam: valid, malformed and legacy rows index as managed, unknown, legacy;
  • fallback: each failure says read: sources and returns the source read's answer.

No real database in CI: SQLite for the store tests, a fake psql/libpq for the Postgres path. Everything under macOS bash 3.2 for the shell half; the indexer may be Python 3 (the suite already requires it).

Not here

Act 3 (Eagle/Raven configuration, Brett's) and act 4 (T058's ledger half, the 001 feature's). #97's lifecycle snapshots and worktree inventories are not indexed (a later word).

Refs brettheap/new-workstation#48, brettheap/new-workstation#26.

Lane: openRepoTools-3

🤖 Generated with Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions