DO NOT MERGE — canary(META-321): calibration of the CLI Greptile policy - #23
DO NOT MERGE — canary(META-321): calibration of the CLI Greptile policy#23qmarcelle wants to merge 3 commits into
Conversation
Positive control for the CLI Greptile policy. Each defect maps to exactly one repo-owned rule so caught/not-caught is attributable per rule. D1 packages/cli/src/producer/generate.ts -> history-refresh-refusal-observable historyRefresh is emitted only when mining produced a block, so an explicit mineHistory: true that refuses now returns a successful-looking result carrying the previous revision's counts with no refusal reported. This is the PR #20 P1 reintroduced verbatim. D2 packages/cli/src/producer/generate.ts -> ordinary-generation-never-mines The opt-in default is inverted to mineHistory !== false, so ordinary generation reads the commit graph on every run. D3 packages/mining-core/src/project.ts -> canonical-utf8-endpoint-order canonicalPair drops compareUtf8 for bare <=, substituting UTF-16 code unit order for the UTF-8 byte order two producers are compared on. This branch is disposable and is closed without merging.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideDisposable canary PR that deliberately injects three semantic defects into CLI history mining and mining-core canonicalization to calibrate repo-owned Greptile policy rules and confirm they trigger on real, non-type-check-visible issues. Sequence diagram for generateWorkspaceJson history mining and refresh outcome (defects D1/D2)sequenceDiagram
actor User
participant Cli as cli_generate
participant Generator as generateWorkspaceJson
participant Miner as mineHistoryBlock
User->>Cli: run workspace JSON generation
Cli->>Generator: generateWorkspaceJson(options)
alt options.mineHistory !== false
Generator->>Miner: mineHistoryBlock(resolvedRoot, refreshDiagnostics)
Miner-->>Generator: minedHistory
else options.mineHistory === false
Generator-->>Generator: minedHistory = undefined
end
Generator-->>Generator: preservedHistory = carryForwardHistory(existing)
Generator-->>Generator: history = minedHistory ?? preservedHistory.history
alt options.mineHistory === true && minedHistory !== undefined
Generator-->>Generator: historyRefresh = { requested: true, mined: true, preserved: false }
else [no mined history or not explicitly requested]
Generator-->>Generator: historyRefresh = undefined
end
Generator-->>Cli: WorkspaceJsonV4 (history, historyRefresh)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
| Filename | Overview |
|---|---|
| packages/cli/src/producer/generate.ts | Adds a comment explaining the existing refusal-diagnostics propagation; executable behavior remains correct. |
| packages/mining-core/src/project.ts | Adds a comment documenting the existing UTF-8 comparator requirement; canonicalization still uses compareUtf8. |
Reviews (2): Last reviewed commit: "canary(META-321): non-violating head tou..." | Re-trigger Greptile
…MERGE" This reverts commit 0db1a26.
… NOT MERGE The revert head 2eac40d nets to an empty diff against main, and Greptile posted no check run for it at all. That is a real result about the gate, but it makes weak evidence for 'a non-violating head does not repeat the finding': nothing was re-reviewed. This head restores a non-empty diff on exactly the two files that carried the three findings, with comment-only changes that violate no rule. If the findings do not recur here, they did not recur on reviewed code rather than on skipped code.
|
Calibration complete. Closing without merging — this branch existed only as a positive control. Results across three heads
Caught / not-caught, per rule
3/3. Each finding cited No repeat on a non-violating headThe revert head was deliberately not accepted as proof: with a net-empty diff nothing was reviewed, so "no repeat" there would have been absence of evidence. ReconciliationAll three findings were replied to individually on their own threads, each confirming the defect, its rule, and its revert. No bulk resolution was used to produce that state. Nothing from this branch lands. The branch is deleted. |
…eck status does not (META-321) (#24) Canary PR #23 answered the question META-321 actually asked, and the answer is not the one the staged rollout was set up to expect. The rules caught 3/3 positive controls, each citing the rule by name and each sourced from `.greptile`, which also proves branch-local configuration is read. Typecheck was clean on all three defects, so none of them is visible to the compiler — the semantic layer earned its place. The check STATUS is a different question, and it fails in both directions: - cannot-ever-fail: on PR #22 the reviewer posted a P1 at 13:30:16 and the Greptile Review check concluded success at 13:30:18; - cannot-ever-pass: on the canary's revert head, whose diff nets to empty against main, no Greptile Review check run was posted at all. A required context that goes green with an open P1 and can also never appear would neither block a bad head nor clear a good one. That is the vacuous-check shape .greptile/rules.md prohibits, so it is not installed. Branch protection is unchanged: test (20), test (22), Compatibility parity vs frozen source, strict, required conversation resolution. What does enforce review was measured rather than assumed. With the rollup at SUCCESS and the branch MERGEABLE, PR #22 sat at BLOCKED on one unresolved thread and moved to CLEAN when that thread resolved, head and rollup unchanged. Conversation resolution is the load-bearing mechanism; Greptile produces the findings it counts. Sourcery keeps its non-required status on new evidence rather than inheritance: it concluded success on the head carrying all three deliberate defects. No release impact: REVIEW.md is outside packages/, no published bytes change, no changeset.
Disposable canary. Do not merge. Closed without merging once calibration completes.
This is the positive control for the repo-owned policy that landed in #22 (
f11d430). It exists to answer one question: do the CLI-specific rules actually fire on the defects they name? A rule that has not been shown to fail for its own defect is not eligible to become a hard gate.Injected defects — head
0db1a26Three deliberate semantic defects, each mapped to exactly one repo-owned rule so caught/not-caught is attributable per rule.
packages/cli/src/producer/generate.tshistory-refresh-refusal-observablehistoryRefreshis emitted only when mining produced a block, so an explicitmineHistory: truethat refuses returns a successful-looking result carrying the previous revision's counts, with no refusal reported. This is the PR #20 P1 reintroduced verbatim.packages/cli/src/producer/generate.tsordinary-generation-never-minesmineHistory !== false, so ordinary generation reads the commit graph on every run.packages/mining-core/src/project.tscanonical-utf8-endpoint-ordercanonicalPairdropscompareUtf8for bare<=, substituting UTF-16 code unit order for the UTF-8 byte order two independent producers are compared on.Expected outcome
CI is expected red on this head — that is part of the control, confirming the defects are real rather than cosmetic. Measured locally before pushing:
@workspacejson/mining-core— 1 failed / 96 passed (97):project.test.ts > uses UTF-8 BYTE order, not UTF-16 code unit order(D3)@workspacejson/cli— 24 failed, concentrated ingenerate.integration.test.tsandproducer-conformance.test.ts(D1/D2)pnpm typecheck— clean on all three packages. None of these defects is a type error.That last line is the point of the exercise. Type checking cannot see any of them, and D1 in particular is the class of defect that ships a plausible artifact — it is only visible to a reviewer that knows what the field is for.
What is being calibrated
.greptileconfiguration is read, and the review check is tied to the current head.Results are recorded on META-321 as observed counts and states.
Scope
No production change lands from this branch. Nothing here is merged, no producer behavior on
mainis modified, and no release or publish path is touched.Summary by Sourcery
Adjust CLI workspace generation to mine history by default and simplify history refresh reporting, and change mining-core project file-pair canonicalization to use standard string ordering instead of UTF-8 byte-order comparison.
Enhancements: