Skip to content

fix: byte-bound secondmate home summaries - #35

Merged
rega10 merged 4 commits into
mainfrom
fm/firstmate-summary-base-surface-byte-bound
Oct 3, 2026
Merged

rega10 merged 4 commits into
mainfrom
fm/firstmate-summary-base-surface-byte-bound

Conversation

@rega10

@rega10 rega10 commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Intent

build it with a simple omission marker

Context: the question was how omitted parts of a second mate's home summary should be shown. Filed 2026-09-06 from the posture display review: the 262144-byte reader limit is enforced only on lifecycle_inventory, so a registry with thousands of projects can still make the whole second mate home summary unreadable and mark the second mate unavailable. The item: byte-bound the complete secondmate home-summary serialization with an omission representation for projects[] and other base surfaces.

What Changed

  • Cap secondmate home summaries at 262144 bytes by trimming oversized base surfaces and adding one omission marker per surface.
  • Preserve producer classification during reads, prioritize parked and archived projects, and disclose byte omissions in Bearings without duplicating row omissions.
  • Document summary bounds and add regression coverage for byte boundaries, classification preservation, and omission reporting. Update the CI test count.

Risk Assessment

✅ Low: The change bounds oversized summaries, preserves producer classifications, and separates byte omissions from row-bound disclosures without introducing a substantiated defect.

Testing

Targeted regressions and all live CLI scenarios passed. Captured serialized summaries, reader output, and Bearings transcripts. The changed surface has no graphical UI.

  • Live validation: ✅ go - 9 of 9 scenarios driven live against the product
Scenario Result Live Evidence
Refresh fitting summaries and preserve baseline bytes, including existing lifecycle inventory bounding. ✅ pass live Live CLI transcript: small. Lifecycle compatibility transcript: lifecycle-fit.
Read an exact 262144-byte summary, then disclose a cut when its input grows one byte. ✅ pass live Live CLI transcript: exact-limit and one-byte-over.
Refresh 4000 projects and keep the secondmate readable, with parked and archived projects retained ahead of active projects. ✅ pass live Adversarial CLI transcript: baseline-overflow and regression-fixed. Bearings disclosure for an oversized registry.
Refresh oversized archived and parked disclosures and receive bounded summaries with the required marker shape. ✅ pass live Live CLI transcript: archived and parked.
Refresh oversized invalidity diagnostics and preserve the producer’s invalid classification through the parent reader. ✅ pass live Live CLI transcript: invalid.
Read summaries with all decision or hold rows cut and preserve their captain-decision or externally-held classification. ✅ pass live Adversarial CLI transcript: captain-cut-to-zero and hold-cut-to-zero.
View byte-cut queued work, holds, and decisions without duplicate row-limit disclosures, while retaining genuine row-limit omissions. ✅ pass live Live CLI transcript: hold-accounting-0 and hold-accounting-3.
View byte-cut landed work without a false row-limit disclosure, while preserving a genuine row-limit disclosure. ✅ pass live Adversarial CLI transcript: landed-cap-0 and landed-cap-303.
Refresh multibyte project names and remain within the byte limit with correct retained and omitted row counts. ✅ pass live Adversarial CLI transcript: unicode-projects.
Evidence: Observed summary sizes, classifications, and omissions

Source: Observed summary sizes, classifications, and omissions

[
  {
    "case": "small",
    "summary_bytes": 1878,
    "state": "no_active_work",
    "valid": true,
    "invalidity_kind": null,
    "omitted": []
  },
  {
    "case": "exact-limit",
    "summary_bytes": 262144,
    "state": "no_active_work",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [],
    "parent_state": "no_active_work",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  },
  {
    "case": "one-byte-over",
    "summary_bytes": 262106,
    "state": "no_active_work",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [
      {
        "surface": "summary_bytes",
        "name": "projects",
        "kept": 2413,
        "omitted": 1
      }
    ],
    "parent_state": "no_active_work",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  },
  {
    "case": "large-registry",
    "summary_bytes": 262122,
    "state": "no_active_work",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [
      {
        "surface": "summary_bytes",
        "name": "projects",
        "kept": 2414,
        "omitted": 1588
      }
    ],
    "parent_state": "no_active_work",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  },
  {
    "case": "archived",
    "summary_bytes": 261523,
    "state": "no_active_work",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [
      {
        "surface": "project_lifecycle",
        "archived_project_count": 256,
        "parked_project_count": 0
      },
      {
        "surface": "summary_bytes",
        "name": "projects",
        "kept": 0,
        "omitted": 300
      },
      {
        "surface": "summary_bytes",
        "name": "omitted.0.archived_projects",
        "kept": 256,
        "omitted": 44
      }
    ],
    "parent_state": "no_active_work",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  },
  {
    "case": "parked",
    "summary_bytes": 261156,
    "state": "no_active_work",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [
      {
        "surface": "project_lifecycle",
        "archived_project_count": 0,
        "parked_project_count": 256
      },
      {
        "surface": "lifecycle_inventory",
        "count": 300
      },
      {
        "surface": "queued",
        "count": 280
      },
      {
        "surface": "summary_bytes",
        "name": "projects",
        "kept": 0,
        "omitted": 300
      },
      {
        "surface": "summary_bytes",
        "name": "queued",
        "kept": 0,
        "omitted": 20
      },
      {
        "surface": "summary_bytes",
        "name": "omitted.0.parked_projects",
        "kept": 256,
        "omitted": 24
      }
    ],
    "parent_state": "no_active_work",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  },
  {
    "case": "invalid",
    "summary_bytes": 261192,
    "state": "no_active_work",
    "valid": false,
    "invalidity_kind": "orphan_in_flight",
    "omitted": [
      {
        "surface": "summary_bytes",
        "name": "reason",
        "kept": 0,
        "omitted": 304544
      },
      {
        "surface": "summary_bytes",
        "name": "invalidity.ids",
        "kept": 256,
        "omitted": 44
      }
    ],
    "parent_state": "no_active_work",
    "parent_summary_valid": false,
    "parent_source": "structured-home"
  },
  {
    "case": "hold-accounting-0",
    "summary_bytes": 261349,
    "state": "captain_decision",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [
      {
        "surface": "summary_bytes",
        "name": "projects",
        "kept": 0,
        "omitted": 1
      },
      {
        "surface": "summary_bytes",
        "name": "queued",
        "kept": 0,
        "omitted": 1001
      },
      {
        "surface": "summary_bytes",
        "name": "holds",
        "kept": 0,
        "omitted": 1001
      },
      {
        "surface": "summary_bytes",
        "name": "decisions_open",
        "kept": 214,
        "omitted": 787
      }
    ],
    "parent_state": "captain_decision",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  },
  {
    "case": "hold-accounting-3",
    "summary_bytes": 261419,
    "state": "captain_decision",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [
      {
        "surface": "decisions_open",
        "count": 3
      },
      {
        "surface": "queued",
        "count": 3
      },
      {
        "surface": "summary_bytes",
        "name": "projects",
        "kept": 0,
        "omitted": 1
      },
      {
        "surface": "summary_bytes",
        "name": "queued",
        "kept": 0,
        "omitted": 1001
      },
      {
        "surface": "summary_bytes",
        "name": "holds",
        "kept": 0,
        "omitted": 1001
      },
      {
        "surface": "summary_bytes",
        "name": "decisions_open",
        "kept": 214,
        "omitted": 787
      }
    ],
    "parent_state": "captain_decision",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  },
  {
    "case": "captain-cut-to-zero",
    "summary_bytes": 261140,
    "state": "captain_decision",
    "valid": false,
    "invalidity_kind": "orphan_in_flight",
    "omitted": [
      {
        "surface": "summary_bytes",
        "name": "queued",
        "kept": 0,
        "omitted": 1
      },
      {
        "surface": "summary_bytes",
        "name": "holds",
        "kept": 0,
        "omitted": 1
      },
      {
        "surface": "summary_bytes",
        "name": "decisions_open",
        "kept": 0,
        "omitted": 1
      },
      {
        "surface": "summary_bytes",
        "name": "reason",
        "kept": 0,
        "omitted": 304244
      },
      {
        "surface": "summary_bytes",
        "name": "invalidity.ids",
        "kept": 256,
        "omitted": 44
      }
    ],
    "parent_state": "captain_decision",
    "parent_summary_valid": false,
    "parent_source": "structured-home"
  },
  {
    "case": "hold-cut-to-zero",
    "summary_bytes": 262081,
    "state": "externally_held",
    "valid": false,
    "invalidity_kind": "orphan_in_flight",
    "omitted": [
      {
        "surface": "summary_bytes",
        "name": "queued",
        "kept": 0,
        "omitted": 1
      },
      {
        "surface": "summary_bytes",
        "name": "holds",
        "kept": 0,
        "omitted": 1
      },
      {
        "surface": "summary_bytes",
        "name": "reason",
        "kept": 0,
        "omitted": 304244
      },
      {
        "surface": "summary_bytes",
        "name": "invalidity.ids",
        "kept": 257,
        "omitted": 43
      }
    ],
    "parent_state": "externally_held",
    "parent_summary_valid": false,
    "parent_source": "structured-home"
  },
  {
    "case": "landed-cap-0",
    "summary_bytes": 261571,
    "state": "no_active_work",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [
      {
        "surface": "summary_bytes",
        "name": "projects",
        "kept": 0,
        "omitted": 1
      },
      {
        "surface": "summary_bytes",
        "name": "landed",
        "kept": 216,
        "omitted": 104
      }
    ],
    "parent_state": "no_active_work",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  },
  {
    "case": "landed-cap-303",
    "summary_bytes": 261602,
    "state": "no_active_work",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [
      {
        "surface": "landed",
        "count": 17
      },
      {
        "surface": "summary_bytes",
        "name": "projects",
        "kept": 0,
        "omitted": 1
      },
      {
        "surface": "summary_bytes",
        "name": "landed",
        "kept": 216,
        "omitted": 87
      }
    ],
    "parent_state": "no_active_work",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  },
  {
    "case": "unicode-projects",
    "summary_bytes": 261504,
    "state": "no_active_work",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [
      {
        "surface": "summary_bytes",
        "name": "projects",
        "kept": 243,
        "omitted": 157
      }
    ],
    "parent_state": "no_active_work",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  },
  {
    "case": "lifecycle-fit",
    "summary_bytes": 261885,
    "state": "no_active_work",
    "valid": true,
    "invalidity_kind": null,
    "omitted": [
      {
        "surface": "project_lifecycle",
        "archived_project_count": 0,
        "parked_project_count": 1
      },
      {
        "surface": "lifecycle_inventory",
        "count": 867
      },
      {
        "surface": "queued",
        "count": 1480
      }
    ],
    "parent_state": "no_active_work",
    "parent_summary_valid": true,
    "parent_source": "structured-home"
  }
]
Evidence: Live CLI transcript

Source: Live CLI transcript

$ FM_HOME=.test-summary-live/mate bin/fm-home-summary-refresh.sh 
{"case": "small", "serialized_bytes": 1878, "state": "no_active_work", "valid": true, "counts": {"active_children": 0, "decisions_open": 0, "holds": 0, "queued": 1, "landed": 0, "endpoints": 0}, "byte_omissions": []}
$ FM_HOME=.test-summary-live/mate bin/.summary-base-producer.sh --secondmate-home-summary
The small summary matches the baseline byte-for-byte.
$ FM_HOME=.test-summary-live/mate bin/fm-home-summary-refresh.sh 
{"case": "boundary-calibration", "serialized_bytes": 217554, "state": "no_active_work", "valid": true, "counts": {"active_children": 0, "decisions_open": 0, "holds": 0, "queued": 1, "landed": 0, "endpoints": 0}, "byte_omissions": []}
$ FM_HOME=.test-summary-live/mate bin/fm-home-summary-refresh.sh 
{"case": "exact-limit", "serialized_bytes": 262144, "state": "no_active_work", "valid": true, "counts": {"active_children": 0, "decisions_open": 0, "holds": 0, "queued": 1, "landed": 0, "endpoints": 0}, "byte_omissions": []}
$ FM_HOME=.test-summary-live/mate bin/.summary-base-producer.sh --secondmate-home-summary
$ FM_HOME=.test-summary-live/parent bin/fm-fleet-snapshot.sh --json
{"case": "exact-limit", "parent_current": {"state": "no_active_work", "reason": null}, "provenance": {"selected": "structured-home", "structured_home": "~/.no-mistakes/worktrees/422718388d14/01M409S7KC2Z9YRNGJQGFPK26V/.test-summary-live/mate", "summary_source": "local-ledger", "summary_valid": true, "trust": "complete", "parent_event_role": "historical-only"}, "invalidity": {"kind": null, "ids": []}, "omitted": []}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh --json --all-queued
{"case": "exact-limit", "bearings_secondmates": [{"id": "bytes-mate", "state": "no_active_work", "doing": "No active child work", "provenance": "structured-home", "freshness": "fresh", "age_seconds": 0, "contradiction": false, "reason": "-"}], "bearings_omitted": [{"surface": "backlog item bodies", "reveal": "--fields bodies"}, {"surface": "task paths", "reveal": "--fields paths"}, {"surface": "watch/steer actions", "reveal": "--fields actions"}, {"surface": "healthy endpoint detail", "reveal": "--fields endpoints"}, {"surface": "full scout-report inventory", "reveal": "--all-reports"}, {"surface": "live PR discovery + checks", "reveal": "--include-prs"}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh 
$ FM_HOME=.test-summary-live/mate bin/fm-home-summary-refresh.sh 
{"case": "one-byte-over", "serialized_bytes": 262106, "state": "no_active_work", "valid": true, "counts": {"active_children": 0, "decisions_open": 0, "holds": 0, "queued": 1, "landed": 0, "endpoints": 0}, "byte_omissions": [{"surface": "summary_bytes", "name": "projects", "kept": 2413, "omitted": 1}]}
$ FM_HOME=.test-summary-live/mate bin/.summary-base-producer.sh --secondmate-home-summary
$ FM_HOME=.test-summary-live/parent bin/fm-fleet-snapshot.sh --json
{"case": "one-byte-over", "parent_current": {"state": "no_active_work", "reason": null}, "provenance": {"selected": "structured-home", "structured_home": "~/.no-mistakes/worktrees/422718388d14/01M409S7KC2Z9YRNGJQGFPK26V/.test-summary-live/mate", "summary_source": "local-ledger", "summary_valid": true, "trust": "complete", "parent_event_role": "historical-only"}, "invalidity": {"kind": null, "ids": []}, "omitted": [{"surface": "summary_bytes", "name": "projects", "kept": 2413, "omitted": 1}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh --json --all-queued
{"case": "one-byte-over", "bearings_secondmates": [{"id": "bytes-mate", "state": "no_active_work", "doing": "No active child work", "provenance": "structured-home", "freshness": "fresh", "age_seconds": 0, "contradiction": false, "reason": "-"}], "bearings_omitted": [{"surface": "backlog item bodies", "reveal": "--fields bodies"}, {"surface": "task paths", "reveal": "--fields paths"}, {"surface": "watch/steer actions", "reveal": "--fields actions"}, {"surface": "healthy endpoint detail", "reveal": "--fields endpoints"}, {"surface": "full scout-report inventory", "reveal": "--all-reports"}, {"surface": "secondmate bytes-mate projects omitted by summary byte limit: 1 (kept 2413)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "live PR discovery + checks", "reveal": "--include-prs"}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh 
$ FM_HOME=.test-summary-live/mate bin/fm-home-summary-refresh.sh 
{"case": "large-registry", "serialized_bytes": 262122, "state": "no_active_work", "valid": true, "counts": {"active_children": 0, "decisions_open": 0, "holds": 0, "queued": 1, "landed": 0, "endpoints": 0}, "byte_omissions": [{"surface": "summary_bytes", "name": "projects", "kept": 2414, "omitted": 1588}]}
$ FM_HOME=.test-summary-live/parent bin/fm-fleet-snapshot.sh --json
{"case": "large-registry", "parent_current": {"state": "no_active_work", "reason": null}, "provenance": {"selected": "structured-home", "structured_home": "~/.no-mistakes/worktrees/422718388d14/01M409S7KC2Z9YRNGJQGFPK26V/.test-summary-live/mate", "summary_source": "local-ledger", "summary_valid": true, "trust": "complete", "parent_event_role": "historical-only"}, "invalidity": {"kind": null, "ids": []}, "omitted": [{"surface": "summary_bytes", "name": "projects", "kept": 2414, "omitted": 1588}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh --json --all-queued
{"case": "large-registry", "bearings_secondmates": [{"id": "bytes-mate", "state": "no_active_work", "doing": "No active child work", "provenance": "structured-home", "freshness": "fresh", "age_seconds": 0, "contradiction": false, "reason": "-"}], "bearings_omitted": [{"surface": "backlog item bodies", "reveal": "--fields bodies"}, {"surface": "task paths", "reveal": "--fields paths"}, {"surface": "watch/steer actions", "reveal": "--fields actions"}, {"surface": "healthy endpoint detail", "reveal": "--fields endpoints"}, {"surface": "full scout-report inventory", "reveal": "--all-reports"}, {"surface": "secondmate bytes-mate projects omitted by summary byte limit: 1588 (kept 2414)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "live PR discovery + checks", "reveal": "--include-prs"}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh 
$ FM_HOME=.test-summary-live/mate bin/fm-home-summary-refresh.sh 
{"case": "archived", "serialized_bytes": 261523, "state": "no_active_work", "valid": true, "counts": {"active_children": 0, "decisions_open": 0, "holds": 0, "queued": 0, "landed": 0, "endpoints": 0}, "byte_omissions": [{"surface": "summary_bytes", "name": "projects", "kept": 0, "omitted": 300}, {"surface": "summary_bytes", "name": "omitted.0.archived_projects", "kept": 256, "omitted": 44}]}
$ FM_HOME=.test-summary-live/mate bin/.summary-base-producer.sh --secondmate-home-summary
{"case": "archived", "baseline_serialized_bytes": 940612, "baseline_state": "no_active_work"}
$ FM_HOME=.test-summary-live/parent bin/fm-fleet-snapshot.sh --json
{"case": "archived", "parent_current": {"state": "no_active_work", "reason": null}, "provenance": {"selected": "structured-home", "structured_home": "~/.no-mistakes/worktrees/422718388d14/01M409S7KC2Z9YRNGJQGFPK26V/.test-summary-live/mate", "summary_source": "local-ledger", "summary_valid": true, "trust": "complete", "parent_event_role": "historical-only"}, "invalidity": {"kind": null, "ids": []}, "omitted": [{"surface": "summary_bytes", "name": "projects", "kept": 0, "omitted": 300}, {"surface": "summary_bytes", "name": "omitted.0.archived_projects", "kept": 256, "omitted": 44}, {"surface": "project_lifecycle", "archived_projects": ["archived-0001-00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

... [787656 bytes truncated] ...

eveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "secondmate bytes-mate invalidity.ids omitted by summary byte limit: 44 (kept 256)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "live PR discovery + checks", "reveal": "--include-prs"}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh 
$ FM_HOME=.test-summary-live/mate bin/fm-home-summary-refresh.sh 
{"case": "hold-accounting-0", "serialized_bytes": 261349, "state": "captain_decision", "valid": true, "counts": {"active_children": 0, "decisions_open": 1001, "holds": 1001, "queued": 1001, "landed": 0, "endpoints": 0}, "byte_omissions": [{"surface": "summary_bytes", "name": "projects", "kept": 0, "omitted": 1}, {"surface": "summary_bytes", "name": "queued", "kept": 0, "omitted": 1001}, {"surface": "summary_bytes", "name": "holds", "kept": 0, "omitted": 1001}, {"surface": "summary_bytes", "name": "decisions_open", "kept": 214, "omitted": 787}]}
$ FM_HOME=.test-summary-live/parent bin/fm-fleet-snapshot.sh --json
{"case": "hold-accounting-0", "parent_current": {"state": "captain_decision", "reason": null}, "provenance": {"selected": "structured-home", "structured_home": "~/.no-mistakes/worktrees/422718388d14/01M409S7KC2Z9YRNGJQGFPK26V/.test-summary-live/mate", "summary_source": "local-ledger", "summary_valid": true, "trust": "complete", "parent_event_role": "historical-only"}, "invalidity": {"kind": null, "ids": []}, "omitted": [{"surface": "summary_bytes", "name": "projects", "kept": 0, "omitted": 1}, {"surface": "summary_bytes", "name": "queued", "kept": 0, "omitted": 1001}, {"surface": "summary_bytes", "name": "holds", "kept": 0, "omitted": 1001}, {"surface": "summary_bytes", "name": "decisions_open", "kept": 214, "omitted": 787}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh --json --all-queued
{"case": "hold-accounting-0", "bearings_secondmates": [{"id": "bytes-mate", "state": "captain_decision", "doing": "Captain decision 1; Captain decision 2; Captain decision 3; Captain decision 4; Captain decision 5; Captain decision 6; …", "provenance": "structured-home", "freshness": "fresh", "age_seconds": 0, "contradiction": false, "reason": "-"}], "bearings_omitted": [{"surface": "backlog item bodies", "reveal": "--fields bodies"}, {"surface": "task paths", "reveal": "--fields paths"}, {"surface": "watch/steer actions", "reveal": "--fields actions"}, {"surface": "healthy endpoint detail", "reveal": "--fields endpoints"}, {"surface": "full scout-report inventory", "reveal": "--all-reports"}, {"surface": "secondmate bytes-mate projects omitted by summary byte limit: 1 (kept 0)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "secondmate bytes-mate queued omitted by summary byte limit: 1001 (kept 0)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "secondmate bytes-mate holds omitted by summary byte limit: 1001 (kept 0)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "secondmate bytes-mate decisions_open omitted by summary byte limit: 787 (kept 214)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "decisions_open showing 20 of 214", "reveal": "--all-decisions"}, {"surface": "live PR discovery + checks", "reveal": "--include-prs"}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh 
{"case": "hold-accounting-0", "surface": "queued", "byte_omitted": 1001, "row_omitted": 0}
{"case": "hold-accounting-0", "surface": "holds", "byte_omitted": 1001, "row_omitted": 0}
{"case": "hold-accounting-0", "surface": "decisions_open", "byte_omitted": 787, "row_omitted": 0}
$ FM_HOME=.test-summary-live/mate bin/fm-home-summary-refresh.sh 
{"case": "hold-accounting-3", "serialized_bytes": 261419, "state": "captain_decision", "valid": true, "counts": {"active_children": 0, "decisions_open": 1004, "holds": 1004, "queued": 1004, "landed": 0, "endpoints": 0}, "byte_omissions": [{"surface": "summary_bytes", "name": "projects", "kept": 0, "omitted": 1}, {"surface": "summary_bytes", "name": "queued", "kept": 0, "omitted": 1001}, {"surface": "summary_bytes", "name": "holds", "kept": 0, "omitted": 1001}, {"surface": "summary_bytes", "name": "decisions_open", "kept": 214, "omitted": 787}]}
$ FM_HOME=.test-summary-live/parent bin/fm-fleet-snapshot.sh --json
{"case": "hold-accounting-3", "parent_current": {"state": "captain_decision", "reason": null}, "provenance": {"selected": "structured-home", "structured_home": "~/.no-mistakes/worktrees/422718388d14/01M409S7KC2Z9YRNGJQGFPK26V/.test-summary-live/mate", "summary_source": "local-ledger", "summary_valid": true, "trust": "complete", "parent_event_role": "historical-only"}, "invalidity": {"kind": null, "ids": []}, "omitted": [{"surface": "summary_bytes", "name": "projects", "kept": 0, "omitted": 1}, {"surface": "summary_bytes", "name": "queued", "kept": 0, "omitted": 1001}, {"surface": "summary_bytes", "name": "holds", "kept": 0, "omitted": 1001}, {"surface": "summary_bytes", "name": "decisions_open", "kept": 214, "omitted": 787}, {"surface": "queued", "count": 3}, {"surface": "holds", "count": 3}, {"surface": "decisions_open", "count": 3}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh --json --all-queued
{"case": "hold-accounting-3", "bearings_secondmates": [{"id": "bytes-mate", "state": "captain_decision", "doing": "Captain decision 1; Captain decision 2; Captain decision 3; Captain decision 4; Captain decision 5; Captain decision 6; …", "provenance": "structured-home", "freshness": "fresh", "age_seconds": 0, "contradiction": false, "reason": "-"}], "bearings_omitted": [{"surface": "backlog item bodies", "reveal": "--fields bodies"}, {"surface": "task paths", "reveal": "--fields paths"}, {"surface": "watch/steer actions", "reveal": "--fields actions"}, {"surface": "healthy endpoint detail", "reveal": "--fields endpoints"}, {"surface": "full scout-report inventory", "reveal": "--all-reports"}, {"surface": "secondmate bytes-mate holds omitted by snapshot bound: 3", "reveal": "raise FM_SNAPSHOT_SECONDMATE_QUEUED"}, {"surface": "secondmate bytes-mate decisions omitted by snapshot bound: 3", "reveal": "raise FM_SNAPSHOT_SECONDMATE_DECISIONS"}, {"surface": "secondmate bytes-mate queued work omitted by snapshot bound: 3", "reveal": "raise FM_SNAPSHOT_SECONDMATE_QUEUED"}, {"surface": "secondmate bytes-mate projects omitted by summary byte limit: 1 (kept 0)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "secondmate bytes-mate queued omitted by summary byte limit: 1001 (kept 0)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "secondmate bytes-mate holds omitted by summary byte limit: 1001 (kept 0)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "secondmate bytes-mate decisions_open omitted by summary byte limit: 787 (kept 214)", "reveal": "shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"}, {"surface": "decisions_open showing 20 of 214", "reveal": "--all-decisions"}, {"surface": "live PR discovery + checks", "reveal": "--include-prs"}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh 
{"case": "hold-accounting-3", "surface": "queued", "byte_omitted": 1001, "row_omitted": 3}
{"case": "hold-accounting-3", "surface": "holds", "byte_omitted": 1001, "row_omitted": 3}
{"case": "hold-accounting-3", "surface": "decisions_open", "byte_omitted": 787, "row_omitted": 3}
All live summary producer, parent reader, and Bearings checks passed.
Evidence: Lifecycle compatibility transcript

Source: Lifecycle compatibility transcript

$ FM_HOME=.test-summary-live/mate bin/fm-home-summary-refresh.sh 
{"case": "lifecycle-fit", "serialized_bytes": 261885, "state": "no_active_work", "valid": true, "counts": {"active_children": 0, "decisions_open": 0, "holds": 0, "queued": 1500, "landed": 0, "endpoints": 0}, "byte_omissions": []}
$ FM_HOME=.test-summary-live/mate bin/.summary-base-producer.sh --secondmate-home-summary
$ FM_HOME=.test-summary-live/parent bin/fm-fleet-snapshot.sh --json
{"case": "lifecycle-fit", "parent_current": {"state": "no_active_work", "reason": null}, "provenance": {"selected": "structured-home", "structured_home": "~/.no-mistakes/worktrees/422718388d14/01M409S7KC2Z9YRNGJQGFPK26V/.test-summary-live/mate", "summary_source": "local-ledger", "summary_valid": true, "trust": "complete", "parent_event_role": "historical-only"}, "invalidity": {"kind": null, "ids": []}, "omitted": [{"surface": "lifecycle_inventory", "count": 867}, {"surface": "project_lifecycle", "archived_projects": [], "parked_projects": ["parked-app"]}, {"surface": "queued", "count": 1480}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh --json --all-queued
{"case": "lifecycle-fit", "bearings_secondmates": [{"id": "bytes-mate", "state": "no_active_work", "doing": "No active child work", "provenance": "structured-home", "freshness": "fresh", "age_seconds": 0, "contradiction": false, "reason": "-"}], "bearings_omitted": [{"surface": "backlog item bodies", "reveal": "--fields bodies"}, {"surface": "parked project work omitted by secondmate summary bound: parked-app", "reveal": "raise FM_SNAPSHOT_SECONDMATE_QUEUED or FM_SNAPSHOT_SECONDMATE_CHILDREN"}, {"surface": "task paths", "reveal": "--fields paths"}, {"surface": "watch/steer actions", "reveal": "--fields actions"}, {"surface": "healthy endpoint detail", "reveal": "--fields endpoints"}, {"surface": "full scout-report inventory", "reveal": "--all-reports"}, {"surface": "secondmate bytes-mate queued work omitted by snapshot bound: 1480", "reveal": "raise FM_SNAPSHOT_SECONDMATE_QUEUED"}, {"surface": "secondmate bytes-mate parked lifecycle facts omitted by summary bound: 867", "reveal": "refresh after parked work decreases; omitted tasks may not resurface at expiry until then"}, {"surface": "live PR discovery + checks", "reveal": "--include-prs"}]}
$ FM_HOME=.test-summary-live/parent bin/fm-bearings-snapshot.sh 
{"case": "lifecycle-fit", "baseline_byte_equal": true, "retained_lifecycle_inventory": 633, "lifecycle_omissions": [{"surface": "lifecycle_inventory", "count": 867}]}
Evidence: Bearings disclosure for an oversized registry

Source: Bearings disclosure for an oversized registry

schema: fm-bearings.v1
home: .test-summary-live/parent
generated: "2026-08-01T18:00:00Z"
prs: "not_requested (run: /bearings include PRs)"
projects: []
contributions: 
  scope: owned contributions per home
  known: 0
  checked: 0
  counts: 
    captain: 0
    fleet: 0
    maintainer: 0
    nobody: 0
  complete: true
  proven_clear: true
  unmeasured_homes: 0
  unreadable_records: 0
  unmeasured: 0
  stale_verdicts: 0
  missing_verdicts: 0
  captain_omitted: 0
  lifecycle_suppressed: 
    archived: 0
    parked: 0
  captain: []
in_flight: []
secondmates[1]{id,state,doing,provenance,freshness,age_seconds,contradiction,reason}:
  bytes-mate,no_active_work,No active child work,structured-home,fresh,0,false,"-"
secondmate_reconcile[1]{id,spawn_gen,host,kind,ids}:
  bytes-mate,null,null,null,"[]"
decisions_open: []
landed: []
gates[1]{id,title,blocked_by,reason,owner,filed}:
  q-active,T,"-","-",bytes-mate,null
reports: []
recorded_prs: []
omitted[7]{surface,reveal}:
  backlog item bodies,"--fields bodies"
  task paths,"--fields paths"
  watch/steer actions,"--fields actions"
  healthy endpoint detail,"--fields endpoints"
  full scout-report inventory,"--all-reports"
  "secondmate bytes-mate projects omitted by summary byte limit: 1588 (kept 2414)","shrink that surface in the secondmate home; omitted content is unread, and an omitted project reads as active"
  live PR discovery + checks,"--include-prs"

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 3 issues found → auto-fixed (2) ✅
  • 🚨 bin/fm-fleet-snapshot.sh:1352 - The complete summary can still exceed 262144 bytes. For example, 3000 archived projects with 100-byte names and one Done record each produce over 300 KB in omitted[].archived_projects alone. This pass empties projects but leaves that disclosure untouched, so summary_file_read still rejects the ledger. Other surviving payloads include parked_projects (bin/fm-fleet-snapshot.sh:1309), reason and invalidity.ids (bin/fm-fleet-snapshot.sh:1262). Budget these nested disclosures and diagnostics at the producer boundary, preserve their classification, and ensure the final serialization fits.
  • 🚨 bin/fm-fleet-snapshot.sh:1349 - Byte cuts can silently turn an unresolved captain decision into an idle classification. With FM_SNAPSHOT_SECONDMATE_DECISIONS=1001, a persistent child secondmate's status can contain 1000 distinct blocked keys with 160-character summaries followed by one needs-decision. The producer reports captain_decision, but this prefix cut drops the final decision. The parent then calls fm_secondmate_summary_at (bin/fm-fleet-snapshot.sh:2123), which derives no_active_work from the retained blocked rows (bin/fm-project-lifecycle.jq:226). The same completeness invariant applies to active_children and holds cuts at bin/fm-fleet-snapshot.sh:1352. Make the shared read-time classifier respect byte omissions rather than infer absence from truncated arrays.
  • 🚨 tests/fm-bearings-snapshot.test.sh:4961 - The added invocation raises the successful suite output from 82 to 83 'ok -' lines, including the new pass at tests/fm-bearings-snapshot.test.sh:4743. The stock macOS CI job still requires exactly 82 at .github/workflows/ci.yml:457, so it fails even when every test passes. Update that expected count.

🔧 Fix applied.
1 warning still open:

  • ⚠️ bin/fm-bearings-snapshot.sh:940 - Round 1 fixed classification but left omission accounting behind. With 1001 decisions and FM_SNAPSHOT_SECONDMATE_DECISIONS=1001, a byte cut retaining k rows causes normalization to create a legacy decisions_open omission count of 1001-k. Bearings then reports those same rows under both snapshot-bound and byte-limit disclosures, recommending a row-limit increase that cannot recover them. Exclude byte-cut omissions from legacy row-bound counters at the shared normalization boundary. Siblings: bin/fm-project-lifecycle.jq:172 (queued), :173 (active_children), :174 (holds), :175 (decisions_open), rendered at bin/fm-bearings-snapshot.sh:925, :928, :931, and :934 respectively.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 9 of 9 scenarios driven live against the product
Scenario Result Live Evidence
Refresh fitting summaries and preserve baseline bytes, including existing lifecycle inventory bounding. ✅ pass live Live CLI transcript: small. Lifecycle compatibility transcript: lifecycle-fit.
Read an exact 262144-byte summary, then disclose a cut when its input grows one byte. ✅ pass live Live CLI transcript: exact-limit and one-byte-over.
Refresh 4000 projects and keep the secondmate readable, with parked and archived projects retained ahead of active projects. ✅ pass live Adversarial CLI transcript: baseline-overflow and regression-fixed. Bearings disclosure for an oversized registry.
Refresh oversized archived and parked disclosures and receive bounded summaries with the required marker shape. ✅ pass live Live CLI transcript: archived and parked.
Refresh oversized invalidity diagnostics and preserve the producer’s invalid classification through the parent reader. ✅ pass live Live CLI transcript: invalid.
Read summaries with all decision or hold rows cut and preserve their captain-decision or externally-held classification. ✅ pass live Adversarial CLI transcript: captain-cut-to-zero and hold-cut-to-zero.
View byte-cut queued work, holds, and decisions without duplicate row-limit disclosures, while retaining genuine row-limit omissions. ✅ pass live Live CLI transcript: hold-accounting-0 and hold-accounting-3.
View byte-cut landed work without a false row-limit disclosure, while preserving a genuine row-limit disclosure. ✅ pass live Adversarial CLI transcript: landed-cap-0 and landed-cap-303.
Refresh multibyte project names and remain within the byte limit with correct retained and omitted row counts. ✅ pass live Adversarial CLI transcript: unicode-projects.
  • TMPDIR="$PWD/.test-summary-live/tmp" bash tests/.summary-byte-targeted.test.sh, selecting the lifecycle-bound and summary-byte-bound regression tests.
  • python3 .test-summary-live/drive.py, driving real summary publication, parent reads, and Bearings JSON and TOON output.
  • python3 .test-summary-live/adversarial.py, reproducing baseline rejection and exercising zero-row cuts, landed omission accounting, and UTF-8 inputs.
  • python3 .test-summary-live/lifecycle-fit.py, comparing lifecycle-bounded summary bytes against the base producer.
  • Removed disposable homes, temporary test drivers, and the baseline producer copy. Verified the working tree was clean.
⚠️ **Document** - 1 warning
  • ⚠️ bin/fm-bearings-contract-lib.sh:290 - The generated Bearings contract lists omission recovery hints but omits the new byte-limit hint. Update its authoritative source in a follow-up. This phase permits only documentation files and doc comments.
✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Rene Garza Jr. added 4 commits October 3, 2026 02:12
…n marker

A registry with thousands of projects pushed the whole home summary past the
262144-byte reader limit, so the parent marked the secondmate unavailable.
The producer now cuts oversized base surfaces (projects first) to fit and
records one summary_bytes marker per cut surface with kept and omitted
counts. Bearings discloses the marker in omitted[]. A summary that already
fits is emitted unchanged.
@rega10
rega10 merged commit 81fa3fd into main Oct 3, 2026
19 checks passed
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