视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
probe-feature-flag-state【文档与办公】Probe the runtime state of a named feature flag in a CLI binary. Covers the four-pronged evidence protocol (binary strings, live invocation, on-disk state, platform cache), the four-state classification (LIVE / DARK / INDETERMINATE / UNKNOWN), gate-vs-event disambiguation, conjunction-gate handling, and skill-substitution scenarios where a flag appea…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Determine if named feature flag in shipped CLI binary is LIVE, DARK, INDETERMINATE, or UNKNOWN. Use four-pronged evidence protocol — pair every state claim with specific observation.
monitor-binary-version-baselines) markers — need classify each candidate flag's rollout state before moving to Phase 4 wire capture.Extract candidate flag name from bundle. Confirm it actually exists as string literal. Without this, all later prongs probe thin air.
# Locate the bundle (common shapes: .js, .mjs, .bun, packaged binary)
BUNDLE=/path/to/cli/bundle.js
FLAG=acme_widget_v3 # synthetic placeholder — replace with the candidate
# Confirm the literal exists
grep -c "$FLAG" "$BUNDLE"
# Capture every line where it appears, with surrounding context for Step 2
grep -n -C 3 "$FLAG" "$BUNDLE" > /tmp/flag-context.txt
wc -l /tmp/flag-context.txt
Inspect /tmp/flag-context.txt. Tag each occurrence as one of:
gate("$FLAG", default), isEnabled("$FLAG"), flag("$FLAG", ...)).process.env.X (or equivalent) lookup.Got: At least one occurrence of flag string in bundle. Each occurrence tagged with its call-site role.
If fail: grep -c returns 0? Flag not in this build. Either input name wrong (typo, wrong namespace) or flag removed in this version. Re-check Phase 1 marker output. Either correct input or classify as REMOVED and stop.
Same string can appear as gate, telemetry event name, env var, or all three. Classification depends on call-site, not on string. Mistaking telemetry name for gate produces nonsense reasoning ("this gate must be off") about something that was never a gate.
For each tagged occurrence from Step 1:
gate("$FLAG", false) defaults flag to off; gate("$FLAG", true) defaults flag to on). Record both literal default and gate function name.UNKNOWN (name present but not a gate).if (process.env.X) { return null; } is kill switch; if (process.env.X) { enable(); } is opt-in.Got: For every occurrence, definite call-site role and (for gate-calls) recorded default value.
If fail: Gate-call's surrounding context too minified to read default? Expand grep context (-C 10) and inspect full callee. Default still can't be determined? Record as default=?. Downgrade any LIVE/DARK conclusion to INDETERMINATE.
Run harness in authenticated session you control. Observe if gated capability surfaces. This is single highest-signal prong: bundle says what can happen, runtime shows what does happen.
Pick probe action that would reveal gate-pass — usually user-visible behavior gate guards (tool appearing in tool list, command flag becoming valid, UI element rendering, output field appearing in response).
# Example shape — adapt to the harness
$CLI --list-capabilities | grep -i widget # does the gated capability appear?
$CLI --help 2>&1 | grep -i "$FLAG" # is a flag-related option exposed?
$CLI run-some-command --debug 2>&1 | tee probe-runtime.log
Record one of three outcomes:
LIVE.DARK; default-true → re-check, this is suspicious).INDETERMINATE.Got: Recorded probe action, observed outcome, candidate classification it points to.
If fail: Probe action itself errors (auth failure, network unreachable, wrong subcommand)? Runtime prong unusable for this round. Fix session or pick different probe action. Don't infer DARK from runtime that never ran.
Many harnesses persist gate evaluations or override values to disk so they need not be re-fetched. Inspecting this state shows what harness believed about flag at last evaluation.
Common locations (adapt to harness — these are shapes, not specific paths):
# User-level config
ls ~/.config/<harness>/ 2>/dev/null
ls ~/.<harness>/ 2>/dev/null
# Per-project state
ls .<harness>/ 2>/dev/null
# Cache directories
ls ~/.cache/<harness>/ 2>/dev/null
# Search any of these for the flag name
grep -r "$FLAG" ~/.config/<harness>/ ~/.cache/<harness>/ .<harness>/ 2>/dev/null
Record each hit's path, value associated with flag, and file's last-modified time. Recently-modified cache entry overriding binary default is strongest possible evidence either way.
Got: Either confirmed override value with timestamp, or confirmed absence (no on-disk state mentions this flag).
If fail: Find flag mentioned but can't tell if recorded value is cached server response, user override, or stale value? Flag entry for Step 5 (platform cache) reconciliation rather than guessing.
Harness uses external feature-flag service (LaunchDarkly, Statsig, GrowthBook, vendor-internal, etc.)? Locally-cached service response is authoritative current rollout state. Inspect it where available.
# Look for service-shaped cache files
find ~/.cache ~/.config -name "*flag*" -o -name "*feature*" -o -name "*config*" 2>/dev/null | head
# If a cache file is present, parse it for the flag name
jq ".[] | select(.key == \"$FLAG\")" ~/.cache/<harness>/flags.json 2>/dev/null
Record cached value, cache timestamp, and (if present) cache TTL. Platform cache that says false overrides binary default of true. Platform cache that says true overrides binary default of false.
Got: Either definite cached value with timestamp, or confirmed absence of flag-service cache for this harness.
If fail: Harness has no flag-service or you can't locate cache? This prong contributes nothing — that's acceptable. Note "Prong D: not applicable" in evidence table. Don't guess.
Some capabilities guarded by multiple flags that must all be true: gate("A") && gate("B") && gate("C"). Any one being DARK is sufficient to make capability DARK. But per-flag classification still belongs to each flag individually.
# After finding the gate-call site for the primary flag in Step 2, scan the
# enclosing predicate for other gate(...) calls
grep -n -C 5 "$FLAG" "$BUNDLE" | grep -oE 'gate\("[^"]+"' | sort -u
For each co-gate string surfaced:
Got: Every conjunct identified and individually classified. Derived capability-level classification.
If fail: Predicate too minified to enumerate cleanly (call site inlined or wrapped)? Record conjunction as "≥1 additional gate, structure unreadable". Downgrade capability-level classification to INDETERMINATE even if primary flag looks LIVE.
Flag may legitimately be DARK while user-facing capability it would unlock is reachable through different, fully-supported route — different command, user-invocable skill, alternate API. Honest finding "flag DARK, capability LIVE via substitution" is common and important. Missing it produces panicked dark-launch reports about capabilities users actually have.
For any candidate classification of DARK or INDETERMINATE, ask:
If yes to any, append substitution: note to evidence row recording alternate route and its observability (how user reaches it, whether it is documented).
Got: For every DARK / INDETERMINATE classification, explicit substitution check — either route, or explicit note "no substitution route identified."
If fail: Suspect substitution exists but can't confirm route? Mark "substitution suspected; not confirmed" rather than asserting either way.
Combine four prongs into single table. Every state claim must be paired with observation that supports it. Re-running probe at new version produces diff-able artifact.
| Field | Value |
|---|---|
| Flag | acme_widget_v3 (synthetic placeholder) |
| Binary version | <version-id> |
| Probe date | YYYY-MM-DD |
| Prong A — strings | present (3 occurrences: 1 gate-call default=false, 2 telemetry) |
| Prong B — runtime | gate-pass not observed in capability list |
| Prong C — on-disk | no override found in ~/.config/<harness>/ |
| Prong D — platform cache | service cache absent / not applicable |
| Conjunction | none — single-gate predicate |
| Substitution | user-invokable widget slash command delivers equivalent UX |
| Final state | DARK (capability LIVE via substitution) |
Apply classification rules:
false, no prong observed gate-pass, no override flips it on.Save table as probe artifact (e.g. probes/<flag>-<version>.md) so future probes diff against it.
Got: Complete evidence table covering all four prongs, conjunction status, substitution status, single final classification.
If fail: No prong yields usable signal (binary can't be read, runtime can't be invoked, on-disk and platform cache both absent)? Don't invent classification. Record INDETERMINATE with reason "no prong yielded signal" and stop.
redact-for-public-disclosure).emit("$FLAG", ...) is label, not gate. Flag that is "telemetry-only" has no rollout state and should be classified UNKNOWN, not DARK.default=false) is not same as runtime evidence (capability did not appear). Flag with default-false in binary may be flipped to true by server-side override. Only runtime probe shows what session actually got.default=true while ignoring surrounding && gate("B") && gate("C") produces falsely confident LIVE for capability that's actually gated by B or C.monitor-binary-version-baselines — Phase 1 of parent guide. Marker tracking this skill builds on supplies candidate flag inventory.conduct-empirical-wire-capture — Phase 4. Deeper runtime evidence (network capture, lifecycle hooks) when Prong B's surface-level probe insufficient.security-audit-codebase — Dark-launched code is part of attack-surface archaeology. This skill is discovery half of that audit.redact-for-public-disclosure — Phase 5. Redaction discipline that decides which probe artifacts can leave private workspace.