Repository navigation
capacity line: a revision field; the poller and ops parsers read older and newer revisions - #2987
Open
colinmegill wants to merge 2 commits into
Open
colinmegill wants to merge 2 commits into
colinmegill wants to merge 2 commits into
Conversation
The small poller's capacity line (and the readiness line's capacity object) now carries "rev" (1 here). A line without it predates revisioning and is revision 1. Python decode_counts and the server's TypeScript decodeCounts read revisions 1..own+8: an older line carries exactly its own keys (newer ones decode as null); a newer line must still carry every key the decoder knows, and the keys its revision declared are checked as counts and dropped, never relayed. Within a decoder's own revisions the shape stays closed. The Python depth decoder reads both 000024's polis-queue/3 reply and 000026's polis-queue/4 (with oldest_eligible_at), so a poller keeps its depth when 000026 is applied under it. delphi/tests/poller/fixtures/capacity-revisions.txt holds a line per revision (pre-revision, 1, 2, 3 and a forward 4); the Python test pins this revision's line to the real emitter and both decoders read every line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s
…lve revision 2 Production (stable) logs nine counts; edge added large_leased, large_poisoned and large_parked. Both shapes were logged without a rev, so both are kept readable: an unrevisioned line is revision 1 or 2, told apart by its keys. This emitter writes rev 2 explicitly. The fixture now holds both unrevisioned shapes, revisions 2..4 and a forward 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s
This was referenced Oct 7, 2026
Delphi Coverage Report
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Observable changes: the small math poller's
math_poller.capacity/1line, and the readiness line's embeddedcapacityobject, gain one key,"rev":2. The server's ops "Math engine" page now parses capacity lines of every revision (production's nine-count line, edge's twelve-count line, and the revisions #2984 and #2985 add) instead of counting the other revisions as malformed; each parsed row carriesrev, and a key the parser does not know is shown as nothing (null for an older line's missing keys; a newer line's extra keys are dropped). The Python depth decoder also reads 000026'spolis-queue/4depth reply (it read only/3). No CloudWatch filter changes (they select schema/class/role, which are unchanged). No schema change. No Lambda.Why
The connections map (§3) found the TS parser and the Python decoder are closed per revision: edge has 12 count keys, #2984 14, #2985 18, under one schema string, and the actual transpiled parser accepted 3/3 matching revisions and refused 6/6 mixed ones. A rolling deploy (old and new pollers logging at once) and retained log history therefore lose ops observations. Separately, edge's poller refuses 000026's
/4depth reply, so applying 000026 under it would blank its depth. Production (stable) logs a third shape, nine keys.Rule
rev, a minor version under the same schema string. Each revision only adds keys (CAPACITY_REV_KEYSindelphi/polismath/poller/capacity.py, mirrored inserver/src/ops/readinessLine.ts).rev; an unrevisioned line is revision 1 or 2, told apart by its exact key set.REV_FORWARD). An older line must carry exactly its own revision's keys (newer known keys decode as null). A newer line must carry every key the decoder knows; the keys only its revision declares must be plain names with count-or-null values and are dropped, never relayed. Within the decoder's own revisions the shape stays closed (an undeclared key is refused).Tests
delphi/tests/poller/fixtures/capacity-revisions.txt: both unrevisioned shapes, revisions 2, 3, 4 (primary and standby) and a forward revision 5.test_capacity_revisions.pypins this branch's revision line to the realbuild_lineoutput and decodes every line;server/__tests__/unit/opsCapacityRevisions.test.tsparses the same file with the TS parser, including the readiness line's embedded object. Negative cases: undeclared key, missing declared key (each revision and both unrevisioned shapes), forward key not a count or not a plain name, revision out of range or not an integer.build_linefrom a realCapacityRouter) × actual parsers (Pythonparse_line/validate_countsand the TS parser through ts-node), primary line + standby line + embedded object, both languages:The six mixed combinations among the three new revisions all pass. The first two rows are the parsers already written; nothing here can change what they accept. The deployed stable parser already refuses edge's twelve-key line today, so the next promotion's roll has that window whatever this PR does; from this PR on, a roll does not.
npm run build,npm run lint,contract:checkclean;sign_lint0 new;test_gateOK.🤖 Generated with Claude Code
https://claude.ai/code/session_018NVGBuYCk4EZmiz4csUv9s