Repository navigation
Conversation
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
d1abca2 to
1f08f82
Compare
|
Thank you for the detailed CLI proposal and its tests. This spans exit-status semantics, environment defaults, output fields and index handling, so we need more time to review the compatibility and scope decisions before giving a direction. Please do not read the triage labels as approval of new defaults. The review queue is currently full, so detailed feedback may take a little time. We are working through it carefully and appreciate the work you have put into supporting the project. Thank you for your patience. |
b2bb18c to
b317506
Compare
A freshness gate cannot read a tool's account of itself — it reads the
process status. index_repository returned 0 for a partial index and the
same 1 for both a missing repository and a pipeline that fell over inside
an existing one, so no caller could tell those apart.
The CLI now grades its own outcome:
0 indexed, quality at or above the thresholds
1 hard failure inside a reachable repository (unchanged meaning)
2 indexed but below a quality threshold
3 repo_path absent, unreadable, or not a directory
The contract is opt-in: it applies only with CBM_GATE set to a non-empty
value other than "0". Without it the CLI exits exactly as before, so a
caller that never asked for grading never sees a new code. Grading
happens in the CLI only. MCP responses are untouched, so agents and the
soak test, which judge by JSON-RPC and tool-level isError, see exactly
what they saw before.
Thresholds are separate on purpose and overridable:
CBM_GATE_MAX_UNUSABLE default 0 a file that did not parse at all
CBM_GATE_MAX_PARTIAL_PCT default 10 share of partially parsed files
Partial parsing marks constructs a grammar does not cover — a property of
language support, not of index quality; this repository itself sits at
5.8%. A gate its own project cannot pass gets switched off.
Two additive fields carry what the grading needs:
files_indexed, parse_partial_pct the denominator the ratio needs and
the share stated outright, so a gate can quote it in a refusal
reason on failures: target_unavailable vs pipeline_failed
Signed-off-by: Vladislav Rahmanov <rahmanov.official@yandex.ru>
The contract landed measured but unpinned: six outcomes were checked by
hand against the built binary and written into the pull request, and
nothing in the suite would notice if a code moved. A verification that
does not run again is a claim, not a test.
Twelve cases over cbm_cli_index_exit_status, which grades a result
envelope into a process exit code:
clean run stays 0; an unusable file and a partial share above the
ceiling both grade 2; "degraded" grades 2 on the status alone; an
absent target grades 3 while a pipeline failure keeps 1 — the pair
that shared code 1 before and gave the whole contract its reason.
Three of them exist to fail if the grader stops working rather than to
pass when it does:
- the ceiling itself is exercised from both sides, 10 of 100 passing
and 11 failing, because a test that only checks obvious excess stays
green with the check switched off entirely;
- the threshold overrides carry a positive control at the defaults, so
"passed after raising the ceiling" cannot be confused with "no check
ran";
- eight unreadable threshold values are pinned to fall back on the
documented default, since a typo that silently disables a gate is the
failure the strict parse was written to prevent.
Silence is pinned too: a null, empty, unreadable, or content-less
envelope preserves the base status in both directions. Inventing a
quality verdict out of an unparsable payload would fail runs for the
crime of an unexpected response shape.
Envelopes are built with yyjson rather than hand-escaped, so the
payload's quoting is the transport's and not the test's own.
Signed-off-by: Vladislav Rahmanov <rahmanov.official@yandex.ru>
b317506 to
b037b48
Compare
|
Reworked after your note on defaults, and narrowed to one claim per the contributing guide. The contract is now opt-in: nothing changes unless Rebased on |
|
Thank you for narrowing the change to the opt-in |
|
Thank you, @Blysspeak, for narrowing this to the opt-in path. We've made the decision: the opt-in The next steps are ours. We'll review the exit-code table for long-term stability, since once CI pipelines depend on those codes we can't renumber them. After that, it merges on a green run against current |
DeusData
left a comment
There was a problem hiding this comment.
Here is the exit-code review we promised, @Blysspeak. The contract is clean and well tested. The "gate off keeps the base status" test and the refusal to let a typo silently widen a threshold are exactly right. There are two small things, and both matter because these codes cannot be renumbered once CI pipelines depend on them:
- Please don't use exit code 2 for a verdict.
main.calready returns 2 for a usage error (an invalid--tool-profile), and shells and CI tooling conventionally read 2 as "usage error". WithQUALITY = 2, a gate cannot tell "the index is below threshold" apart from "the command was invoked wrongly". Could you move the two verdict codes to values nothing else uses, for exampleQUALITY = 10andTARGET = 11, and keep 0 and 1 as they are? Please also state in the header comment that these values are a stable contract. - Use the shared environment reader.
cli_gate_thresholdre-implementscbm_env_long(src/foundation/platform.h). That is the project's strict whole-number reader, written for exactly this "a typo must not silently disable a setting" case, and it handles the Windows environment consistently.cbm_env_long(name, &value) ? value : fallbackkeeps your semantics.
Everything else can stay as it is. Once these two are in and CI is green against current main, this merges. Thank you.
|
Thanks again for narrowing the opt-in gate. The last review asks for verdict codes that do not collide with usage errors and reuse of the shared strict environment reader. Those two requests remain the next step; the accepted opt-in direction is already recorded above. |
Brings the opt-in index exit contract up to date with main a222715. Two conflicts, both additive on each side: - src/mcp/mcp.c, the error branch of handle_index_repository: main's DeusData#1665 export-error hint and this branch's "reason" field are independent. The reason (target_unavailable vs pipeline_failed) is computed first; main's hint selection follows unchanged. - tests/test_cli.c: main's DeusData#2200 update test and this branch's exit contract tests were both appended after the same test; both are kept. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
The binary already exits 2 for a usage error (an invalid --tool-profile), and shells and CI tooling read 2 that way. With the quality verdict on 2 a gate could not tell "the index is below threshold" from "the command line was wrong". The two verdicts move to codes nothing else uses: 0 indexed, at or above the thresholds (unchanged) 1 hard failure in a reachable repository (unchanged) 10 indexed, below a quality threshold (was 2) 11 target unavailable (was 3) The header now states that these values are a stable contract, and a new test pins the four numbers so a renumbering fails in the suite rather than in a caller's pipeline. Requested in the maintainer review of DeusData#2092. Co-authored-by: Vladislav Rahmanov <rahmanov.official@yandex.ru> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
cli_gate_threshold re-implemented the project's strict whole-number environment reader and missed one case: strtol skips leading blanks, so CBM_GATE_MAX_PARTIAL_PCT=" 20" was read as 20, although the test lists a leading blank as unreadable. cbm_env_long (src/foundation/platform.h) refuses empty text, leading blanks, trailing junk and out-of-range values, leaves its output untouched on refusal, and reads the Windows environment the same way every other setting does. Anything unreadable now falls back to the documented default. The test's numeric-looking unreadable values move from 10 to 50. At 10 they equalled the default, so a reader that wrongly accepted one still failed the 20% payload and the test could not tell the difference. At 50 an accepted value passes the run and the test fails; against the previous reader it does, on " 50". Requested in the maintainer review of DeusData#2092. Co-authored-by: Vladislav Rahmanov <rahmanov.official@yandex.ru> Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you, @Blysspeak, for this contract and for the care that went into it. The opt-in switch, the positive control in "gate off keeps the base status", the boundary test at exactly 10 of 100, and the refusal to let a typo silently widen a threshold are exactly what a CI-facing contract needs, and they made this an easy review. Because this branch allows maintainer edits, we made the two adjustments from the September 25 review ourselves instead of asking you for another round. Your two commits are untouched; three commits sit on top of them:
The table in the description above predates this change: with it, the two verdicts are 10 and 11. Once CI is green on the new head, this merges, as agreed in September. Thank you again for your patience through a long queue, and for narrowing the change so cleanly. |
|
Thank you again for the opt-in exit contract. The October updates record the verdict-code and shared environment-reader adjustments as completed on our side, so no repeat contributor work is requested. Sorry for the delay in the remaining maintainer follow-up—I’ll follow up soon. |
Brings the opt-in index exit contract up to date with main 0433142. The merge is clean; no file this branch changes needed a resolution. The previous base (fceb25d) predates the shared CI baseline (72c3604), whose language-count contract repair is why every test leg failed at Step 0w on the last run. That failure was in the base, not in this branch. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you again, @Blysspeak, for the opt-in exit contract and for your patience while we followed up. Here is that follow-up. The last CI run failed on every test leg at the same step, the published language-count contract. That check was repaired on main after this branch was last updated, so the failure came from the old base and not from your change. We pushed one commit on top of the branch: a merge of current main (aaee484). It merged without conflicts, and this PR's diff against main is unchanged: the same five files and the same 498 added lines. Your two commits and the two adjustments described in the October 20 comment are untouched. Before merging we checked the contract again on the previous head. The cli suite passes. With the two adjustments reverted, exactly the two tests that pin them fail: the one that pins the four exit codes (0, 1, 10, 11) and the unreadable-threshold case " 50". So both adjustments stay covered by the suite. If you push to this branch again, please pull first, since it now includes this merge. Once CI is green on the new head, this merges as agreed. Thank you again for the care you put into this contract. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thanks again, @Blysspeak. Several other pull requests landed on main this evening, including changes in files this one also touches, so we merged current main into your branch once more (one signed-off merge commit, f4ad327; your changes are untouched). That keeps the required checks honest against today's tree; we will merge once they are green. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @Blysspeak. CI went green on this branch, but tonight's merges on main touched src/mcp/mcp.c, which this pull request also changes, so that green no longer covered today's main. We merged current main into the branch once more (one merge commit, c8fd93a; your changes are untouched) and will merge once the fresh checks are green. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @Blysspeak. CI went green on this branch, but this evening's merges on main touched files this pull request also changes, so that green no longer covered today's main. We merged current main into the branch once more (one merge commit, c04d419; your changes are untouched) and will merge once the fresh checks are green. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @Blysspeak. A pull request that merged into main a few minutes ago (#2290) changes src/cli/cli.c, which this pull request also changes, so the CI run in progress here could no longer vouch for today's main. We merged current main into your branch once more (one merge commit, 182f7e1; it merged cleanly and your own change is untouched) and started a fresh run. We will merge once the required checks are green. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @Blysspeak. A pull request that merged into main a few minutes ago (#2600) changes src/mcp/mcp.c, which this pull request also changes, so the CI run in progress here could no longer vouch for today's main. We merged current main into your branch once more (one merge commit, b2c62b1; it merged cleanly and your own change is untouched) and started a fresh run. We will merge once the required checks are green. Please pull before pushing again. |
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
|
Thank you for your patience, @Blysspeak. A pull request that merged into main tonight (#2017) changes src/main.c, which this pull request also changes, so CI on this branch could no longer vouch for today's main. We merged current main into your branch once more (one merge commit, baf1ada; it merged cleanly and your own change is untouched) and started a fresh run. We will merge once the required checks are green. Please pull before pushing again. |
Refs #2168
Opt-in exit contract for
cli index_repositoryA freshness gate cannot read a tool's account of itself, it reads the process
status. Today
index_repositoryreturns0for an index that parsed part ofthe tree, and the same
1whether the repository is missing or a pipeline fellover inside one that exists. Callers cannot tell those apart.
Nothing changes unless
CBM_GATE=1is set. Without it the CLI exitsexactly as before. With it, grading happens in the CLI only; MCP responses are
untouched, so agents and
scripts/soak-test.sh, which judge by JSON-RPC andtool-level
isError, see exactly what they saw before.CBM_GATE=1status: degraded)repo_pathabsent, unreadable, or not a directoryThresholds, both optional, negative disables the check:
CBM_GATE_MAX_UNUSABLE, default0, absolute count of unparsable filesCBM_GATE_MAX_PARTIAL_PCT, default10, share of partially parsed filesThe two defaults differ deliberately. A file that did not parse at all is a
defect and gets no tolerance. Partial parsing marks constructs a grammar does
not cover, a property of language support rather than of index quality: this
repository itself sits at 5.8% with a fully working graph. A gate its own
project cannot pass gets switched off, which protects nothing.
Additive fields
files_indexedandparse_partial_pcton the index response. The ratio hadno denominator, and a gate that can only pass or fail cannot say how
partial a parse was.
reasonon failures,target_unavailableorpipeline_failed. The hinttext read identically for both.
Verification
Full suite on this branch: 8001 passed, 1 failed, 7 skipped. The one failure is
daemon_ipc_posix_single_uid_userns_real_smoke_issue1830, which fails the sameway on a clean build of
mainat 055fbb7 on this machine (user-namespacesetup), so it is unrelated to this change.
13 tests in the
clisuite pin the contract, including that an unset, emptyor
0CBM_GATEleaves the historical status untouched.End to end on this repository (clean git worktree of this branch, isolated
CBM_CACHE_DIRandCBM_RUNTIME_DIR), exit status read without a pipeline so$?is the command's own:The same sequence against a binary built from
mainat 055fbb7 gives1 / 0 / 1 / 0 / 0: today's status, unchanged by the variable.