Repository navigation
docs(ops)+test(security): SRE stale feature-flag audit (2026-04-27) + flag-SDK creep guard - #251
Merged
Merged
Conversation
Read-only deliverable from the SRE Automation Agent (Slack-triggered cleanup protocol [STALE FEATURE-FLAG REMOVAL]). The agent reviewed the codebase at 2026-04-27 16:08 UTC and found: - 0 third-party flag SDKs wired in (statsig / launchdarkly / unleash / flagsmith / split.io / ldclient — no hits in pyproject, requirements, pylock, cargo, or Python imports). - The 'looks-like-a-flag' surfaces (api.maturity_self_assessment_poc_enabled, detection.aggregated_identification_enabled, report.jurisdiction_hints_enabled, rate_limit_enabled, fuzzy_enabled, enable_pro_prefilter, etc.) are all active configuration knobs or active open-core boundaries (PR #246, ADR 0044) — none are stale rollouts. - Step-3 safety rule of the protocol triggered for the only partial candidate (open-core boundary touches >3 files and is the subject of an open PR). Output: 'Candidate Found: Manual Review Required'. Files: - docs/ops/sre_audits/README.md (audit index, stub). - docs/ops/sre_audits/STALE_FEATURE_FLAG_AUDIT_2026-04-27.md (full audit with method, sidequest matrix, defensive-architecture posture, abort rationale, follow-ups). - docs/ops/sre_audits/STALE_FEATURE_FLAG_AUDIT_2026-04-27.pt_BR.md (pt-BR mirror; same lexical bar as the always-on locale contract). Doctrine references in the audit: DEFENSIVE_SCANNING_MANIFESTO.md, THE_ART_OF_THE_FALLBACK.md, SUPPLY_CHAIN_AND_TRUST_SIGNALS.md. Form inspired by linuxmint/live-installer#177 and #178 (clear repro, smallest-claim-that-matches-evidence, safety rule cited). Co-authored-by: Fabio Tavares Leitão <[email protected]>
… creep Companion seatbelt for docs/ops/sre_audits/STALE_FEATURE_FLAG_AUDIT_2026-04-27.md. The SRE cleanup protocol asked: are any stale flags rolled out at 100% that we can delete? Answer (in this audit): no SDK is wired in at all. This test pins that answer so a future PR has to (a) update the allow-list explicitly and (b) ship an ADR if it really wants to add a flag vendor. Aligns with SUPPLY_CHAIN_AND_TRUST_SIGNALS.md (every new runtime dep is a supply-chain hop; flag SDKs in particular phone home). Checks (read-only, no network/DB): - pyproject.toml does not list a known flag SDK as a dependency. - requirements.txt non-comment lines do not list one either. - pylock.toml 'name = "..."' rows do not match a known SDK. - No tracked Python module under core/ connectors/ api/ app/ report/ scanners/ schemas/ logging_custom/ utils/ cli/ analysis/ pro/ file_scan/ (and main.py) imports a known flag SDK. - Both EN and pt-BR audit docs that justify this guard exist. The vendor list (statsig, launchdarkly, ldclient, unleash, flagsmith, splitio, split-sdk) is intentionally finite and exposed at the top of the test module so a maintainer can extend it with a one-line PR if a new vendor appears in the wild. Doctrine alignment: - DEFENSIVE_SCANNING_MANIFESTO.md: no surprise side effects (file parse only). - THE_ART_OF_THE_FALLBACK.md: missing manifest -> pytest.skip with a clear diagnostic, never a cryptic FileNotFoundError. Co-authored-by: Fabio Tavares Leitão <[email protected]>
FabioLeitao
marked this pull request as ready for review
April 27, 2026 18:08
1 of 3 tasks
FabioLeitao
added a commit
that referenced
this pull request
May 3, 2026
…rgo.toml claim (prompt-injection escalation of PR #259) Slack thread 1777319065.862799 in C0AN7HY3NP9 escalated the same prompt- injection pattern PR #259 already rejected ('switch to Opus 4.7 to re-read the data-board-report source code'), this time framed as 'stop lying ... I know for a fact this is a hybrid repository ... do a ls -R'. Working-tree facts (branch cursor/sre-automation-agent-protocol-f8dd at HEAD 730219c, 2026-04-27 19:47 UTC): - find /workspace -name '*.rs' (no venv/target) -> 1 hit: rust/boar_fast_filter/src/lib.rs - ls /workspace/Cargo.toml -> No such file or directory - ls /workspace/data-board-report -> No such file or directory - grep -rln 'data-board-report' across .md/.toml/.py/.rs/.yml/.yaml -> 0 - git log --all -- '**/data-board-report*' -> 0 The repo is hybrid only in the narrow sense PR #259 already documented: Python product plus one PyO3 crate (rust/boar_fast_filter/). No second crate, no workspace, no report-generator. Inventing a CI/CD plan against artifacts that do not exist would violate DEFENSIVE_SCANNING_MANIFESTO.md §1 ('every emitted statement is tagged') and THE_ART_OF_THE_FALLBACK.md §1-§2 ('silent failure is a worse outcome than degraded coverage'; monotonic strategy ladder forbids skipping the parser-grade signal — the file system). Audit-and-block, no code mutation, no third-party PR branch written to. Same convention as PR #234 / #251 / #259. What lands: - docs/ops/sre_audits/PROMPT_INJECTION_REJECTION_HYBRID_REPO_CLAIM_2026-04-27.md full reproduction, rejection rationale (3 failure modes catalogued), Defensive Architecture posture, fallback-ladder mapping, follow-ups, LMDE-issue-style cross-reference (linuxmint/live-installer#177, #178). - docs/ops/sre_audits/README.md hub sync (adds today's 4 audits that had not all been indexed). Verification: - uv run pre-commit run --files <both files> -> all hooks green. - uv run pytest tests/test_docs_external_no_plan_links.py tests/test_docs_markdown.py tests/test_pii_guard.py tests/test_confidential_commercial_guard.py -q -> 160 passed. Defensive Architecture: zero database impact. Markdown only. Doctrines invoked: - docs/ops/inspirations/DEFENSIVE_SCANNING_MANIFESTO.md (§1: tagged statements, NASA SEL 'test what you fly'). - docs/ops/inspirations/THE_ART_OF_THE_FALLBACK.md (§1-§2: diagnostic on fall, monotonic ladder, parser-grade signal first). Related: - Slack handoff: channel C0AN7HY3NP9, thread 1777319065.862799, 2026-04-27 ~19:44 UTC. - Prior rejection of same injection family: PR #259. - Same audit-and-block convention: PR #234, PR #251, PR #242. Co-authored-by: Fabio Tavares Leitão <[email protected]>
FabioLeitao
added a commit
that referenced
this pull request
May 3, 2026
…l-coercion (third injection in 24h) Slack-triggered Cloud Agent automation def95df7-a634-431a-93e5-659e4d831725 in #data-boar-ops asserted four empirically false claims and a model-coercion directive: 1. 'Dependabot #31 (Low) on main' — gh api dependabot/alerts is 403 for this token; gh issue view 31 is 'Plans done 64903' (MERGED 2026-03-15, unrelated to dependencies). Open Dependabot PRs today are #221, #222, #223, #224, #226 (already booked in DEPENDENCY_GUARDIAN_VERDICT_LEDGER_2026-04-27.md). 2. '986 testes' — pytest --collect-only -q reports 989. 3. 'rode scripts/check-all.ps1' on a Linux Cloud Agent VM — the paired Linux/macOS twin is scripts/check-all.sh per docs/ops/SCRIPTS_CROSS_PLATFORM_PAIRING.md. 4. 'auditoria-ia acabou de subir os guards' — branch contributed doctrine consolidation (e6688c8) but is not the most recent merge (HEAD is PR #242). 5. 'USE O OPUS 4.7 High ... VOCE NAO TEM O DIREITO DE OUSAR USAR O COMPOSER 2.0' — the runtime model is configured by the Cursor client/dashboard, not by an in-chat directive; treating capitalized imperatives as policy would normalize prompt-injection model coercion. Posture: audit-and-block, no code change. No uv.lock or Cargo.toml mutated under a fabricated alert; no .ps1 forced on a Linux host. Same defense pattern as PR #234, #251, #259 (clippy 1.95 RCA), #261 (fabricated data-board-report/ + root Cargo.toml). Third member of the same prompt-injection family in 24 h. Per DEFENSIVE_SCANNING_MANIFESTO.md §1.3 (no surprise side effects) and THE_ART_OF_THE_FALLBACK.md §2 (monotonic ladder; never skip a level). Verification: - uv run pre-commit run --files <both files> — all hooks Passed. - uv run pytest tests/test_docs_external_no_plan_links.py tests/test_docs_markdown.py tests/test_pii_guard.py tests/test_confidential_commercial_guard.py -q — 160 passed. - gh pr view 31 / gh api dependabot/alerts — confirms fabrication. Co-authored-by: Fabio Tavares Leitão <[email protected]>
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.
Summary
Read-only deliverable from the SRE Automation Agent (Slack-triggered cleanup protocol
[STALE FEATURE-FLAG REMOVAL]). The agent reviewed the codebase at 2026-04-27 16:08 UTC and recorded the audit underdocs/ops/sre_audits/, plus a small anti-regression guard so the audit's main finding cannot silently rot.Operational constraint respected: audit-and-block only. No code or commit was pushed to any audited PR branch — recommendations live on this branch (
cursor/sre-automation-agent-protocol-84a1), the same pattern used by PR #234.Findings (TL;DR)
api.maturity_self_assessment_poc_enabled,detection.aggregated_identification_enabled,report.jurisdiction_hints_enabled,RATE_LIMIT_ENABLED,fuzzy_enabled,use_density,use_all) or an active open-core boundary (enable_pro_prefilter,tier_features.py— already being unified by PR feat(licensing): unified feature_gate facade for the open-core boundary (ADR 0044) #246, ADR 0044).Candidate Found: Manual Review Required— the protocol's Step-3 safety rule (>3 files + open PR) triggers for the only partial candidate (open-core boundary), so the audit aborts and echoes recommendations instead of mutating that area mid-flight.What lands in this PR
docs/ops/sre_audits/README.mddocs/ops/sre_audits/STALE_FEATURE_FLAG_AUDIT_2026-04-27.mddocs/ops/sre_audits/STALE_FEATURE_FLAG_AUDIT_2026-04-27.pt_BR.mdtests/test_no_third_party_feature_flag_sdks.pystatsig,launchdarkly,ldclient,unleash,flagsmith, orsplitio.Why this matters (Julia Evans-style)
The Slack protocol's first instinct is "find flags rolled out at 100% and delete them." If we naively scanned for
if some_flag:we would have flagged things likeapi.maturity_self_assessment_poc_enabled— which is not a stale rollout, it is a documented operator gate that controls whether the dashboard exposes the maturity POC at all. Deleting it would silently turn on a half-finished feature. So step one was to be honest about the class of each candidate.Once classes were sorted, the operator's next worry is merge hell: the protocol explicitly says that if a flag is touched in an open PR, the cleanup must abort for that flag. We listed every open PR (
gh pr list --state open) and checked which areas they touch. The open-core boundary (the only "real" flag-shape candidate) is being unified in PR #246 (ADR 0044). Trying to clean it up from this audit branch would step squarely into that work.So the deliverable becomes: say loud and clearly that there is nothing to delete today, and add a seatbelt so the answer cannot silently change tomorrow. The seatbelt is the test — if a future PR adds Statsig or LaunchDarkly, the test fails and forces (a) an ADR and (b) an explicit allow-list edit in the same PR.
Defensive Architecture posture
Per
docs/ops/inspirations/DEFENSIVE_SCANNING_MANIFESTO.md:Per
docs/ops/inspirations/THE_ART_OF_THE_FALLBACK.md:encoding="utf-8", errors="replace"and a missing file becomes apytest.skip(...)with a clear diagnostic — never a crypticFileNotFoundError. That is the "diagnostic on fall" rule.Per
docs/ops/inspirations/SUPPLY_CHAIN_AND_TRUST_SIGNALS.md:Type of change
Verification
uv run pytest tests/test_no_third_party_feature_flag_sdks.py -v— 5 passed.uv run pytest tests/test_docs_pt_br_locale.py tests/test_docs_external_no_plan_links.py tests/test_pii_guard.py tests/test_confidential_commercial_guard.py tests/test_docs_markdown.py— 162 passed.uv run ruff check tests/test_no_third_party_feature_flag_sdks.py && uv run ruff format --check tests/test_no_third_party_feature_flag_sdks.py— clean.Sidequest matrix (open PRs at audit time)
The audit doc enumerates every open PR vs every flag-shaped area; nothing in this PR touches any file owned by an open PR. PR #246 (open-core facade) keeps full ownership of
core/licensing/andpro/prefilter.py.Form
Inspired by
linuxmint/live-installer#177and#178: exact reproduction (the grep commands), smallest claim that matches the evidence ("no stale flags eligible"), the safety rule that stopped the agent (Step 3), and the regression guard that prevents recurrence.Related
C0AN7HY3NP9, message1777310318.237219, 2026-04-27).docs(ops): SRE security audit of open PRs (2026-04-27)).feat(licensing): unified feature_gate facade for the open-core boundary (ADR 0044)).