Skip to content

Epic: security-relevant helpers have one implementation each #2539

Closed
7 of 7 issues completed
Closed

Description

@schlessera

Outcome

Each security-relevant helper has exactly one implementation, in the lowest package every caller can depend on, and every caller uses it. The helpers in question are the subscription-billing credential guard, the public-address (SSRF) and robots.txt guard for outbound fetches, symlink-safe path containment, frontmatter block splitting and the governance-policy file read. A fix to one of them lands once and protects every caller.

Why now

A repository review on 2026-10-22 (main dcf5341aa) found each of these written two to five times, with the copies already disagreeing on edge cases. A missed entry in a billing guard means unexpected API billing. A containment copy that forgets symlinks is a path escape. A splitter that accepts a different closing fence reads a different body than the indexer. This epic closes those findings: #2493, #2502, #2506, #2507, #2508.

Shared context

Constraints and non-goals

  • No new seam. These are concrete helpers in an existing package, not pluggable interfaces (ROADMAP "What binds future work", item 2).
  • Dependencies run one way: a helper moves down (into brain-common or brain-scrape), never into a package its callers may not depend on. Any new edge goes through tests/allowed-edges.ts.
  • Behaviour is preserved unless a child proves the surviving copy was wrong. Where copies disagree, the child names which rule wins and adds a test that fails on the losing behaviour.
  • ./internal entries of brain-common carry no public compatibility promise. A public export of a moved helper is a contract change and needs its own ruling.
  • Out: rewriting the governance-policy format, changing what the billing guard clears, and changing scrape's politeness policy beyond identity and bounds.

Breakdown

All seven native children are closed. The merged-child receipts and complete family/lint audit below govern parent completion; child closure alone is not that audit. Each original family moves its helper and deletes the copies:

The five original families are independent and can land in any order. #3422 and #3423 were filed from #2506's work and build on its shared helper.

Definition of done

  • For each family, a repo-wide grep (the one named in its child) finds one implementation and no hand copy. Where a copy is cheap to reintroduce (inline startsWith(root + "/"), a frontmatter fence regex), a lint check refuses it.
  • Each moved helper has its unit tests in the package that owns it, so bun run test packages/<owner> catches a regression without a consumer's suite.
  • Every disagreement between former copies is resolved by a named test, recorded in its child's PR.

Found by a repository review on 2026-10-22.

2026-10-22 triage at main ca8842828ed8634a84c4e8aa4a88e487238721b4: refreshed verified current-source pointers by their named anchors. Scope, recorded decisions and remaining prerequisites are unchanged; source inspection supplies no new runtime or epic-completion evidence.

2026-10-24 continued triage at main dc5d3c73282c29a3f0098306d398743ee18ec791: Verified the still-separate splitter implementations and refreshed the hygiene splitFrontmatter declaration anchor. Existing helper-family ownership, child rulings/behavior-preservation proof and p1/security classification remain; no consolidation or security repair is claimed.

2026-10-25 triage at main ab746a434c4ada11734ffea4e208d1d6211f1aca: Verified moved current-source anchors and refreshed navigation. Historical failed receipts, existing rulings and unresolved prerequisites are unchanged; this is not a new runtime qualification.

2026-10-25 triage at main c670449d3bf1b0639e50ce554d728961f4313add: Verified the moved named current-source anchors and refreshed navigation. Historical evidence keeps its source identity; scope, decisions, native membership and unresolved prerequisites are preserved.

Triage 2026-11-03 (main 3d3516a02): #2493 and #2502 are delivered; their shared-context bullets now point at the single implementations. Attached follow-ups #3422/#3423 are in the breakdown; refreshed the hygiene frontmatter-regex anchor.

2026-11-04 triage at main 53b862123d7b8e4c9d039859fabdc9fc6ad4cd36: Retired stale open-PR and pending-ruling statements using native closure and merged-commit ancestry; #2507 and #3423 remain the open children. No new runtime qualification or implementation is claimed.

Triage 2026-11-08 at main 1619741f291f525d17cde4970a5ada40644117c1: Reconciled all seven closed native children and the final parser-aligned policy-review delivery against merged-commit ancestry and current source. Preserve p1, 0.45.0 and the full family/lint definition of done; no new runtime proof or epic closure is claimed.

Sub-issues

Sub-issues

7 of 7 Issues completed
Loading 7 sub-issues

Activity

  1. added
    type: refactor
    area: core
    area: ui-sdk
    area: ui-server
    area: backends
    area: scrape
    priority: p1
    epic
    security
    on Oct 21, 2026
  2. schlessera commented on Oct 21, 2026

    @schlessera
    OwnerAuthor

    2026-10-22 triage at main ca8842828ed8634a84c4e8aa4a88e487238721b4: refreshed verified current-source pointers by their named anchors. Scope, recorded decisions and remaining prerequisites are unchanged; source inspection supplies no new runtime or epic-completion evidence.

  3. 3 remaining items

  4. schlessera commented on Oct 24, 2026

    @schlessera
    OwnerAuthor

    2026-10-24 triage at main dc5d3c73282c29a3f0098306d398743ee18ec791: Verified the still-separate splitter implementations and refreshed the hygiene splitFrontmatter declaration anchor. Existing helper-family ownership, child rulings/behavior-preservation proof and p1/security classification remain; no consolidation or security repair is claimed.

  5. schlessera commented on Oct 25, 2026

    @schlessera
    OwnerAuthor

    2026-10-25 triage at main ab746a434c4ada11734ffea4e208d1d6211f1aca: Verified moved current-source anchors and refreshed navigation. Historical failed receipts, existing rulings and unresolved prerequisites are unchanged; this is not a new runtime qualification.

  6. schlessera commented on Oct 25, 2026

    @schlessera
    OwnerAuthor

    2026-10-25 triage at main c670449d3bf1b0639e50ce554d728961f4313add: Verified the moved named current-source anchors and refreshed navigation. Historical evidence keeps its source identity; scope, decisions, native membership and unresolved prerequisites are preserved.

  7. added this to the 0.45.0 milestone on Nov 2, 2026
  8. added a commit that references this issue on Nov 3, 2026
  9. schlessera commented on Nov 3, 2026

    @schlessera
    OwnerAuthor

    Epic state — 2026-11-03

    The definition of done's lint gate for inline containment now lives in #3423.

  10. added a commit that references this issue on Nov 3, 2026
  11. schlessera commented on Nov 4, 2026

    @schlessera
    OwnerAuthor

    Epic state — 2026-11-04 (inspected main 53b862123d7b8e4c9d039859fabdc9fc6ad4cd36)

    Delivered on inspected main: #2493, #2502, #2506, #2508 and the #3422 containment-answer ruling. The #3424 and #3418 merge commits are verified ancestors. Remaining open: #2507 (frontmatter splitter) and #3423 (remaining containment callers and lint gate). The body no longer describes those delivered PRs/ruling as pending. No complete security-helper audit or new runtime proof is claimed.

    The epic remains outside agent-ready; work continues through its native children.

  12. added a commit that references this issue on Nov 4, 2026
  13. schlessera commented on Nov 5, 2026

    @schlessera
    OwnerAuthor

    Epic state — 2026-11-05 (inspected main 35217d283b849b5ef81700d5d4c2ec7486405d12)

    #3423 is delivered through #3575 / #3576. Of seven native children, only #2507 remains open; its partial shared-splitter use does not establish the full eight-site and lint-guard acceptance criteria. The brief now points to the consolidated containment and policy-read owners.

    This reconciles source and tracker state. It supplies no new runtime qualification, complete-epic proof or release commitment.

  14. added a commit that references this issue on Nov 6, 2026
  15. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    Epic state — 2026-11-08 (main 1619741f291f525d17cde4970a5ada40644117c1)

    All seven native children are closed. #2507 is completed by #3462 plus merged #3649 (4e359a5229a4abf481c2ec4cc78bda81ab22fa0d, verified on main). The policy review now uses the shared splitter and is no longer a fence-lint exception. #3666 is a separately deferred accepted-input narrowing decision. The parent remains a closure candidate subject to its full family/lint audit and existing release attribution; this triage supplies no new runtime proof.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: backendsarea: corearea: scrapearea: ui-sdkarea: ui-serverepicpriority: p1securitytype: refactor

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions