tracker
All repositories: gitoria
10.6 KB
# HM62 — native person indexes: stopped at a Hybriel migration gap**This candidate is incomplete and must not be deployed.** Branch `hm62-personindex` ends at `66f83de373e3863323d734edfed2db999e0570fe` (WIP). It starts at the required main `90734c6`, with the first branch commit `380ba349cda0951b3d61701afc43c8af92b93344` merging `hm61-peopleorder` at `b5357ac411a784c120aaa2febd27c963cb7cd136`. Nothing was merged to main, pushed, deployed, or run on byrodin.The mission says “Hybriel gap: STOP with a repro for Anton, never a workaround.” A small migration/rollback reproduction found that mpackdb can silently miss a person in newly declared indexes after old-schema code writes the same store. I stopped implementation and the real-copy experiment at that point. This report is the handoff for Anton; I did not create or change a ticket.## Exact reproduction and resultThe committed `tools/hm62-migration-repro.hl` uses only the existing public `MPackDB` API. Run it four times against one **fresh disposable** `HM62_DB` path with `HM62_PHASE` set in this order:1. `seed`: open `@id` with `['!oldId']`, insert `{ id = 'first', oldId = 'first', urlSegment = 'First', tmdbId = 1 }`, persist and close.2. `build`: open with `['!oldId', 'urlSegment', 'tmdbId']`. Lookup `First` succeeds. Persist and close.3. `oldwrite`: open again with only `['!oldId']`, insert `{ id = 'second', oldId = 'second', urlSegment = 'Second', tmdbId = 2 }`, persist and close. This models rollback followed by a person creation.4. `verify`: reopen with all three indexes. Fetch `second` by primary key and query `Second` by slug and `'2'` by TMDB ID.Expected results are `pk=true`, `slug=1`, and `tmdb=1`. Actual results were:```textseed rc=0build rc=0 build first=1oldwrite rc=0verify rc=0 verify pk=trueverify slug=0verify tmdb=0```The complete runner is `/media/STORAGE/claude-scratch/tracker/HM62/migration-repro.py`; it uses `./bin/hybriel tools/hm62-migration-repro.hl` from `wt` and captures metadata after each phase. Its current fixture is already populated: select a fresh fixture path in the runner before repeating. A copy of the minimal source, runner and instructions is also in `wt/.scratch/hm62-index-schema/`. The tiny synthetic `migration-fixture/` is retained for inspection; it contains no restored personal data.`migration-repro.log` records every command result. After `build`, `persons.idxstate.json` has `coveredBytes=53`; after `oldwrite`, it has `coveredBytes=109`. The old writer advances the common state and writes the old schema back into `persons.meta.json`, but leaves the two added field index files at their old coverage. Reopening with the new schema accepts those existing, nonempty files and the advanced shared coverage. The missing record is still present and readable by primary key. No error is emitted.Runtime evidence: binary SHA256 `6b481aa717128a5e2a35f0652606fbeed422227ed7f32c3a6fb26f3d859cd78f`; vendored `plugins/mpackdb/libmpackdb.so` SHA256 `f12e112fe6965c4e0ba47095e8067abd538d487e33a93ab2bebeac7f48003a82`. These were copied without re-vendoring.## Index declaration, live migration and rollbackThe inspected plugin source explains the result. `plugins/mpackdb/engine.zig` constructs the schema from each opener's options (`open`, line 683 onward), writes changed metadata, and initializes indexes under the table mutation lock. `initIndexes` (line 1859) rebuilds when a declared index file is absent/empty or the common index state is stale. `rebuildIndexes` (line 2080) scans the data and rebuilds all declared indexes. The schema is rendered from that handle's own declarations, and coverage is shared across the table rather than independently recorded for each field.For a quiescent existing store lacking the added files, the normal first open of the proposed code builds `persons.urlSegment.txt` and `persons.tmdbId.txt`, plus the other declared indexes, automatically. There is no separate application migration API needed for that initial build. The table remains `@id`, with `compact=false`; this change requests no compaction or record transformation. The proposed fields are deliberately nonunique to preserve migrated duplicate rows and existing map winner behavior. New-person slug suffix selection remains application logic.**A supported live plan cannot be approved from this work.** The first-open duration on 1.22 million persons and its RSS cost were not measured before the required stop. Concurrent old/new standby operation was not tested, and is not certified safe. In addition to those unknowns, the sequential rollback/redeploy case above is already proven unsafe: old code can read and write using its original schema, but a later new-code open can silently miss those writes. A normal standby swap or rollback must not be described as safe based only on the initial build succeeding. Anton needs to resolve index validity across schema changes/old-schema writers, after which both concurrent handover and rollback must be tested on a copy. No forced rebuild, deletion of index files, runtime patch, or other workaround was implemented.## WIP application changes and available behavior proofThe WIP declares `urlSegment` and `tmdbId` on `personsTable`, removes the two runtime lookup maps and their boot-scan insertions, and performs exact indexed cursor queries. The helper takes the final matching row's ID in storage order, matching the old maps' last assignment. Slug lookup then fetches that ID through the primary key, retaining the old behavior for duplicate primary-key rows. TMDB lookup stringifies the query as before. The packed people order from tracker#61 remains included. Search text, title maps and catalog representation were not changed.`tests/person-index.hl` passed on both archived main `90734c6` and the WIP. It checks duplicate slug/TMDB winners, numeric and string TMDB queries, absent/empty/null slug input, absent TMDB lookup, conflict suffixes through `Same-Name-4`, repeated cast import, existing guest lookup, new guest creation from a stored show's cast, immediate lookup of the new guest, and a second guest visit. Evidence is `fixture-before.log` and `fixture-wt.log`, both ending `person-index: passed`. This focused fixture does not replace real-copy HTTP comparisons, the complete gates, or browser proof. `git diff --check` passed before committing.## Required measurements and gates: not completedThe brief contains two baseline references: its explicit BEFORE instruction names `90734c6`, while the generic proof bullet retains `2e7d625`. I selected `90734c6`, matching the explicit task baseline and branch instruction. No comparison against `2e7d625` is claimed.Disk had 185 GB available before preparation. Only `storage/` from `/media/STORAGE/deploy-backups/tracker.worldapi.org/tracker.worldapi.org-20261104-0940.tgz` was extracted to `HM62/copy`, excluding posters and profiles. No sessions or `.env` were restored or read. The baseline recipe followed HM1, with all jobs off, `HL_HOST=127.0.0.1`, port 8712, `HL_GC_STATS=1`, and `HL_CACHE_DIR` inside HM62. Temporary application-only instrumentation was prepared for four identical streamed person censuses, using normal allocation-triggered collection. The baseline was stopped during startup after the reproduction demonstrated the gap; it never reached a valid warmed measurement. The extracted real copy was deleted.| Requested metric/check | Before | After ||---|---|---|| Warmed marked objects, at least 10 GCs | Not obtained | Not obtained || Warmed live_bytes | Not obtained | Not obtained || Median mark_ms and pause_ms | Not obtained | Not obtained || Completed boot scan time | Not obtained | Not obtained || Process RSS / native index cost | Not obtained | Not obtained || Real-copy HTTP status, Location and HTML comparison | Not run | Not run || All 11 gates, zero failures | Not run | Not run |No gate lock was acquired and no gate suite was started after the required stop. The candidate is not gate-approved. Required Chrome confirmation was also unavailable: the initial SSH check to lisbeth `192.168.178.50:22` returned `No route to host`. No browser, tab or tunnel was opened; the final Chrome target list could not be obtained. `chrome-error.txt` preserves the error, and the empty `chrome-initial.json` is not evidence of an empty target list.## Cleanup and next work`stopped.json` records SIGTERM to setup/orchestration PID **3829348** and baseline app PID **3846624**, after checking their cwd under HM62. Extraction tar PID **3829352** completed. The initial background launcher PID **3820476** had already exited without extracting or starting a server; preparation was then rerun as a managed foreground tool session. Short fixture/repro processes and their compiler children exited normally; their individual PIDs were not captured, a process-accounting limitation. No Chrome, tunnel, request loop or gate server was started. `process-final.json` shows only the Codex harness, code-mode host and the audit command in HM62, with no remaining application or compiler. `cleanup-port.txt` contains the final `ss -ltnp '( sport = :8712 )'` header with no listener. `copy/` is gone. Temporary measurement instrumentation exists only in the archived scratch baseline, not in the committed branch.Next: Anton fixes or specifies schema-change index invalidation with this minimal repro; a fresh worker then resumes the WIP, rechecks the complete behavior (including duplicate primary keys and the real-copy pages), measures automatic first-open build and steady-state RSS, proves standby and rollback, captures at least 10 warmed GCs per version under identical load, runs all 11 gates under the shared lock, and obtains the required browser confirmation. Until then, no live migration step is authorized by this report.DOCS: Read the mission, complete archived WORKER-RULES, HL-PRIMER and CODE-ORDER; consulted project.hl, README configuration/testing/data/vendor sections, HM1's report/start recipe/instrumentation/deltas and log, HM61's report and measurement scripts, archived RULINGS, project CONDUCTOR.md, the complete mpackdb README/class/cursor API, and the engine's open/schema/index-build code. The current MANUAL path was absent; archived RULINGS supplied the rulings. No component or style work was involved. The material gap is safe persisted index validity across schema changes and old-schema writers, demonstrated above; no language bypass was used.This stop used roughly 30 model/tool interactions: about 12 for brief/source/setup, 8 for the WIP and fixture, 4 for the migration reproduction, and 6 for cleanup/commit/report. Exact billed USD is unavailable. No subagents or paid external services were used. Only this report was written in the main repository; no LOG/STATUS edits were made.
Branches
Latest commits
- d2e6d26bMerge branch 'records-park55' into mainTracker
- f567f025|||PR records: park #55, no Claude workers ruleTracker
- c21aff6bMerge branch 'records-hm55c' into mainTracker
- 9ba258d3|||PR records: HM55b resultTracker
- 64f2d300Merge branch 'records-hm55b2' into mainTracker
- ae3b80dc|||PR records: HM55b briefTracker
- 7ef3cb3bMerge branch 'records-st55' into mainTracker
- fec2e080|||PR records: STATUS HM55Tracker
- 8e174918Merge branch 'records-hm55b' into mainTracker
- b1ecee57|||PR records: HM55 stateTracker
- 28eab08cMerge branch 'records-hm55' into mainTracker
- d3edaa05|||PR records: HM55 start, PROCEDURES.mdTracker
- 3059f86cMerge branch 'records-design-rule' into mainTracker
- 421a4809|||PR records: his-design rule (Apollo 2026-11-13)Tracker
- d1390692Merge branch 'records-dp75b' into mainTracker
- a4d1a7d2|||PR records: later steps checked, branch auditTracker
- e070e16fMerge branch 'records-dp75' into mainTracker
- 642b4fa8|||PR records: DP75 day62 live, AP62 briefTracker
- bfc4ea4dMerge branch 'ap62' into mainTracker
- 2c95ac46|||PR AP62: re-vendor Hybriel set day62 (source 70341ad2, bin a54f5f08)Tracker