Repository navigation
Commit 42ff7fd
committed
docs(context-budget): record why the measurement lib is not adopted yet
A review asked this branch to source bin/fm-context-measure-lib.sh and delete
its inline measure_context, since the lib's header names this branch and
docs/scripts.md calls it the single owner. That was declined by standing
decision. This records the refusal with its evidence so a later reader sees a
reasoned decision rather than a finding that was quietly skipped.
The adoption is not refused in principle; one owner is the agreed end state. A
straight swap today would delete working behavior, in four ways, the fourth
found by that review: the lib slurps where this streams, it has no
compaction-boundary tally that genuine-reset detection depends on, it dedupes
multi-block turns by requestId, and it does not drop synthetic zero-usage
entries.
That fourth difference makes the lib's own caller wrong rather than merely
different. On a transcript of one 300,010-token turn followed by the synthetic
zero-usage entry written when a turn ends abnormally, the lib returns 0 with
exit status 0, so a caller reads it as a real measurement. bin/fm-session-pulse.sh
then takes its under-threshold branch and removes the once-per-session
handover-due marker, so an interrupted turn makes that session forget a handover
was due. Reproduced end to end. That is a defect in the sibling hook, is not
repaired here, and is tracked as fm-session-pulse-false-zero.
The agreed end state is the reverse move: put this streaming implementation,
with rule 3 and the compaction tally, into the lib and have both callers adopt
it, under its own tests and review as fm-context-measure-lib-adoption.1 parent acb99c3 commit 42ff7fd
1 file changed
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
460 | 499 | | |
461 | 500 | | |
462 | 501 | | |
| |||
0 commit comments