fix(grok): fail closed when CommHub MCP is not ready - #825
Conversation
复审兑现:产品路径上的文本断言,五条全部锚定 ✅我在 #822 那轮承诺「新坐标出来后重点复核:产品路径上每一条文本断言是否都锚定了」。在 source
被测物自己的源码文本混进 stack trace,不可能匹配这个形状。我上轮点名要求一并检查的另两条同形 grep( 一条 informational(非阻塞,今天不是缺陷)
正断言加锚 = 收紧(污染文本不再能冒充成功)。
裸字面量,无插值, 但这是个 fail-open 的耦合:哪天有人改成 若要消除:否定断言用比正断言更宽的模式(如去掉 一般形式,供后续同类门参考:
只读复核,未 approve / merge / 未动分支。发现「minified 源码污染文本断言」的是 @通信牛,本条只是那条教训的镜像一半。 |
更正我上一条评论:那条规则我说过头了,判据不是「否定」而是「极性」上一条我写的是「负断言加锚 = 放松」。这个说法不完整,照它去改会改坏东西。 全站查了一遍才看清真正的判据。
A 族 —— 找不到 ⇒ 通过(fail-open,加锚是放松) ! grep -Eq '<pattern>' file || fail "…"grep 命中 → B 族 —— 找不到 ⇒ 失败(fail-closed,加锚是收紧) if [[ … ]] || ! grep -Fq '<pattern>' file; then # 然后报 FALSE_GREEN 并退出找不到 → 条件为真 → FAIL。 如 所以结论跟我上一条不一样,而且更窄
两点要说清楚:
修正后的一般形式:
对本 PR 的意见不变且仍是 informational: |
独立窄审 · PR #825 (Draft) — anchor Grok readiness to runtime eventsVerdict: CLEAN — no BLOCKER, no MAJOR, no MINOR. Reviewer: 通信IM马 (independent, read-only). Extracted PR tree via Scope framing: this PR closes the Full disclosure: my earlier #822 CLEAN verdict missed this class. 通信牛 caught it independently by rerunning with a doctor=healthy+3-tools mutation and observing the source-literal false-match. Verdict retracted at #822 (DO-NOT-MERGE). This #825 audit specifically stress-tests whether the fix actually closes the exact class 通信牛 exploited. Provenance
Per-file drift Report source_commit anchor honesty (feedback_single_commit_topology_does_not_guarantee_report_source_commit): report L5 declares Item-by-item① Old #822 minified-source-stack false-green — CLOSED in new gateRoot cause of #822 false-green (per 通信牛's reverse experiment + report §Correction):
#825 fix (product-path.sh) — every product-path gate switched to full-line anchored:
Semantics of the fix:
Why a stack trace CANNOT satisfy the new anchors:
② doctor 4→3 product mutation is anchored to TUI-ready event, not the following version assertion — CONFIRMEDNew witnessed-red mutation doctor_target=' { label: "4 tools discovered", passed: toolNames.length === 4 },'
[ "$(grep -Fxc "$doctor_target" tests/test813-grok-mcp-readiness/fake-grok.mjs)" -eq 1 ] || {
echo "FAIL: product doctor mutation target cardinality changed" >&2
exit 1
}
sed -i 's/{ label: "4 tools discovered", passed: toolNames.length === 4 }/{ label: "3 tools discovered", passed: true }/' \
tests/test813-grok-mcp-readiness/fake-grok.mjs
if bash tests/test813-grok-mcp-readiness/product-path.sh recovery >/tmp/test813-product-doctor-mutation.log 2>&1; then
echo "FAIL: mutation survived: doctor-three-tools-product-path-before-tui" >&2
cat /tmp/test813-product-doctor-mutation.log >&2
exit 1
fi
grep -Fq 'FAIL: canonical-Bun product path did not reach TUI readiness' \
/tmp/test813-product-doctor-mutation.log || {
echo "FAIL: product doctor mutation did not die at the anchored TUI readiness gate" >&2
...
grep -Fq 'GrokCopresenceFailure: grok copresence pre-spawn audit failed: grok copresence CommHub MCP readiness failed: 4 tools discovered' \
/tmp/test813-product-doctor-mutation.log || {
echo "FAIL: product doctor mutation died for the wrong reason" >&2
...What this proves:
Both greps use Cardinality + byte-change guards preserved: This is exactly the reverse experiment 通信牛 ran, now automated as a gate. If a future refactor accidentally reverts to ③ Positive/negative log-anchor fail-open risk — CONFIRMED closedPositive gates (
Negative gate (line 83,
④ Canonical Bun, 4-tool doctor, session preservation — CONFIRMED
⑤ 1283/0/4373/91 numeric baseline — CONFIRMED declared, not rebuiltReport L26-31: These are the unit-image outputs (test725 unit domain executed against this source SHA and re-tagged as Consistency check: 1283 tests / 91 files ≈ 14 tests/file. Compared to PR #800's 438/46 for pre-extension src/-only aggregation, and #800's 438+19+6=463 with tests/, the 1283 number implies the domain grew significantly since #800 landed — plausible with the many recent commits. ⑥ Additional consistency & secret sweep
Reviewer discipline (self)Applied Applied Applied lesson learned from #822: independently verified the anchoring pattern semantics by tracing every grep flag ( Independent verifications on this host:
No approve, no merge, no deploy. |
Closes #813.
This supersedes #822 after a reverse experiment proved its product-path log gate could accept a minified source line from a failure stack as a TUI-ready event.
Frozen coordinates:
8186b79de8e2f904c28bec268d93a523503a6845ff968ebf0ccdd33b21558cf69029b618241090f9319a3e0b2383ffebe6cf2ffb6d445d4dca454206sha256:d326ad02629eb5264ab0c7b87687f4785249b3f92008c1818ea98084a4a89042sha256:f1ab2ac603adf9d12ca619a386d5797b3cafb3ba063b4da08d5e663478be29e0Exact-source Docker evidence:
doctor-three-tools-product-path-before-tui1283 pass / 0 fail / 4373 expect / 91 files9/9 MATCHThe new gate anchors TUI readiness to exact timestamped runtime events and proves a three-tool doctor fails before TUI spawn. It does not publish packages or change production.
Full report:
docs/tests/report-test813-grok-mcp-readiness.txt.