knowledge: keg-only PATH + double-quote backslash (2 verified platforms insights) - #17
Open
choiyounggi wants to merge 1 commit into
Open
knowledge: keg-only PATH + double-quote backslash (2 verified platforms insights)#17choiyounggi wants to merge 1 commit into
choiyounggi wants to merge 1 commit into
Conversation
…e-quote backslash) + defer 1 (MLIR IRDL)
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.
Knowledge flush — 3 insight(s): 2 ingested, 1 held back
Drained 3 pending candidates from
~/.dev-loop/queue. Two were verified andmerged into existing
platformspages; one (MLIR IRDL) is verified-but-niche andheld back from this general wiki with a recommendation (see Routing decision).
Verified best-practice
1. Homebrew keg-only formulae are installed but off
PATH→verifiedwhich <tool>/command -v <tool>reporting not-founddoes not mean the tool is absent. Homebrew keg-only formulae (llvm, curl,
openjdk, node@N, libpq, ruby) are installed into the Cellar but deliberately not
symlinked onto
PATH. Check the package manager's record before concludingabsence.
"installed only into the Cellar and is not linked into the default prefix");
brew info llvmoutput ("llvm is keg-only, which means it was not symlinkedinto /opt/homebrew").
which mlir-opt→"mlir-opt not found" (exit 1) and
command -v mlir-opt→ not found, whilebrew list --versions llvm→llvm 22.1.8and/opt/homebrew/opt/llvm/bin/mlir-opt --version→ "Homebrew LLVM version22.1.8". This is the exact incident from the queue (issue knowledge: validating a check whose target does not exist yet (1 insight) #7 deferred on a stale
whichcheck though LLVM 22.1.8 was installed).2. Bash double-quote strips the backslash only before five chars →
verifiedmeaning only before
$, backtick,",\, or newline. So a regex embedded ina double-quoted string has
"\$"collapse to a bare$(a regex end-of-lineanchor) before the tool ever sees it, while
"\d"keeps its backslash. Miscopythe pattern as
$or\\$and the EOL match silently changes.https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html — the
backslash "retains its special meaning only when followed by one of"
$,backtick,
",\, or newline (page fetched and the sentence confirmed present2026-08-04).
od -con the guardrails-stylepattern
"(sh|bash)([[:space:]]|-|<|\$)"shows the byte reaching grep is a bare$(backslash stripped);echo 'curl http://x | sh' | grep -E "$pat"matchesshat end-of-line, confirming$acts as the EOL anchor. Matches the queueincident (why
curl … | shwith no trailing char matches the bash-guard rule).3. MLIR IRDL region ops fail verification without a borrowed terminator →
field-testedfails block verification ("block with no terminator") because IRDL cannot
declare a terminator op or attach
NoTerminator/setRegionKindonuser-defined ops. Either embed a borrowed terminator
(
omp.terminator/llvm.unreachable) or model the nesting with flat marker opscarrying a
childrenid-list attribute.a terminator; a single-block region may opt out only via
NoTerminatoron theenclosing op); https://mlir.llvm.org/docs/Dialects/IRDL/ (
irdl.dialectitself carries
NoTerminator, but the op-definition surface exposes no way toattach that trait or set
RegionKindon the ops you define). The mechanics aredoc-corroborated; the specific IRDL limitation is not stated as such in the docs.
mlir-opt 22.1.8(region op →"block with no terminator"; only
omp.terminator/llvm.unreachableverifiedinside a generic IRDL region; flat marker ops round-tripped cleanly). Not
re-reproduced here (no dialect fixture on hand).
the IRDL-can't-set-it limitation has no official-doc statement.
Existing-layer check
wiki/platforms/environment/path-resolution.md(merge, not new).Read the full page. Its "load when" line already owns "'command not found'
though the tool is installed"; it already had a brew-shadowing row and a
which→type/command -vInstead-of row. Gap: none of those cover thekeg-only case where even
command -v/typecorrectly report not-found becausethe binary is genuinely unlinked (absence-on-PATH ≠ not-installed). Merged one
Edge casesrow + oneInstead ofrow + one source; no duplication, noconflict. Related links already point to
toolchains/version-managementandprocesses/background-services(both relevant, left as-is).wiki/platforms/shells/portable-shell-scripts.md(merge, not new).Read the full page plus the adjacent
shells/command-text-inspected-before-execution.md(the candidate arose in aguardrails PreToolUse hook, which that page owns). That page is about a gate
reading command text; this lesson is about the shell mangling an embedded
regex — a quoting-semantics fact, so it belongs on portable-shell-scripts (the
quoting page), which the two pages already cross-link via
related:. The page's"Do this knowledge: kubelet resource metrics on embedded k8s; host-to-pod memory limit sizing #2" says "quote every expansion" but nowhere states the double-quote
backslash-stripping rule. Merged one
Edge casesrow + oneInstead ofrow +one source; no duplication, no conflict.
seeded categories (
platforms/toolchains= version pinning;infrastructure= CI/CD) genuinely do not cover "how MLIR's region verifier interacts with
IRDL-defined ops." No merge target exists.
Routing decision
platforms/environment/path-resolution(merged). The harvesteddomain: infrastructurehint was wrong — this is a PATH-resolution symptom, nota CI/CD/build concern. No new category.
platforms/shells/portable-shell-scripts(merged). The harvesteddomain: securityhint was incidental (the bug surfaced in a guardrails hook);the reusable lesson is bash double-quote semantics, owned by
platforms/shells.No new category.
correct, but it is single-repo compiler-internals with no home in the current 10
general SWE domains. Ingesting it would mean creating a
compilers/mlirdomainfor one insight loadable by exactly one repo — which the wiki's own philosophy
(one case per page, cross-repo reusability) argues against. Recommendation:
keep it in the owning repo's own docs (e.g. a dialect NOTES file), or, if you
want the wiki to carry dialect-authoring knowledge, say so and I will open a
dedicated
compilersdomain in a follow-up. Logged as agapentry inlog.md.All 3 candidates are retired from the active queue so auto-flush will not re-run
them; the MLIR row is preserved in
.processed.jsonl(statusdeferred-out-of-scope).