Skip to content

[P0] Remove qualification-repository tuning from production retrieval and claims #660

Description

@mohanagy

Parent: #649
Depends on: #655, #659

Outcome

Restore scientific and product independence between Madar’s production retrieval/context behavior and the repositories/tasks used to qualify it.

Remove or generalize exact status-page/OpenStatus-era paths, symbols, phrases, boosts, forced selections, demotions, and fixed claim builders from production code. Add a protected boundary preventing qualification knowledge from returning.

Confirmed evidence

The v0.32.1 audit found production behavior tied to concepts including:

  • packages/api/src/router/statusPage.ts;
  • trpc.statusPage.get.queryOptions;
  • HTTPCheckerHandler;
  • UpdateStatus();
  • cloudtasks.NewClient;
  • CreateTask;
  • status-page projection/incident semantics;
  • exact preferred/forced candidate patterns and score boosts;
  • status-specific fallback demotions.

The repository name itself may not appear. The coupling is encoded through exact paths, symbols, concept arrays, ranking fragments, and fixed claim builders.

Matching strings can change selection, ranking, retained lines, or generated claims in unrelated repositories. Existing tests currently protect some special cases rather than proving general behavior.

Scope

1. Complete production audit

Search production code for direct and indirect qualification knowledge, including:

  • exact repository names;
  • exact paths or normalized path suffixes;
  • symbol-name arrays;
  • task phrases and aliases;
  • hard-coded scoring boosts/demotions;
  • preferred/forced files;
  • status-specific expected phases;
  • fixed context claims;
  • benchmark-specific task classifiers;
  • path/symbol fragments encoded in regexes/templates/case variants.

Classify each occurrence as:

  • production ranking/candidate generation;
  • production graph expansion;
  • production execution-path logic;
  • production claim generation;
  • production implementation guidance;
  • production fallback;
  • legitimate generic framework behavior;
  • test/fixture;
  • benchmark/documentation;
  • dead code.

For every production occurrence record activation condition, behavior impact, unrelated-repository risk, tests, and replacement/removal decision.

2. Remove, generalize, or quarantine

  • Remove exact repository/task dependencies from general production ranking and claim generation.
  • Replace behavior only when a generic typed signal is justified by non-benchmark evidence.
  • Generic replacements may use typed route/controller/queue/consumer/dataflow facts, direct source evidence, evidence quality, or registered framework semantics.
  • Do not replace one exact string list with a disguised synonym list.
  • Preserve benchmark documentation and fixtures only in approved benchmark/test locations.
  • Existing tests should be rewritten to verify generic semantics rather than exact qualification artifacts.

3. Add benchmark-independence boundary

Create a versioned forbidden-knowledge manifest covering:

  • qualification repository names;
  • exact paths;
  • symbols;
  • task phrases;
  • normalized fragments;
  • known aliases.

Protected scanning should cover production source and detect, where practical:

  • string/template/regex literals;
  • path fragments across slash/case variants;
  • camel/snake/kebab normalization;
  • symbol arrays;
  • score/preference tables;
  • manually preferred files;
  • claim-builder constants.

Allow benchmark, fixture, test, and documentation locations through an explicit allowlist.

Exceptions require:

  • owner;
  • generic product justification;
  • non-benchmark tests;
  • review approval;
  • expiry/revalidation date.

Failure output must identify file, line, rule, and normalized match.

4. Add independence tests

At minimum:

  • unrelated repository containing similar strings must not receive fixed claims without typed evidence;
  • a hidden/renamed status implementation must still work where generic facts support it;
  • removing a qualification literal must not be replaced by task-text overfitting;
  • hidden holdout quality must remain non-inferior;
  • direct source evidence is required for high-confidence repository-specific claims.

Explicit non-goals

  • No broad retrieval rewrite.
  • No discretionary ranking redesign beyond removal/generalization of contaminated rules.
  • No graph architecture changes.
  • No new framework support.
  • No vector/embedding initiative.
  • No benchmark prompt changes to accommodate regressions.
  • No accepting a known regression merely because special cases are undesirable; expose and track the underlying generic capability gap.

Replacement standard

A special rule may be replaced with a generic behavior only when:

  1. the generic concept is defined independently of the benchmark repository;
  2. at least one non-qualification fixture exercises it;
  3. a holdout verifies generalization;
  4. the behavior is evidence-backed and source-attributed;
  5. it does not synthesize repository-specific claims from matching names alone.

Otherwise remove the rule and create a separate capability issue rather than preserving hidden overfitting.

Required tests and validation

  • forbidden-manifest scanner positive/negative fixtures;
  • exact known production occurrences detected before removal;
  • approved test/docs allowlist;
  • unrelated-string collision fixture;
  • renamed/hidden implementation holdout;
  • retrieval/context-pack differential review;
  • no unexplained critical-fact regression;
  • no production match for the forbidden manifest;
  • complete protected suite and qualification gates.

Acceptance criteria

  • Every identified qualification-specific production occurrence is classified and resolved.
  • No exact qualification repository path, symbol, phrase, or equivalent encoded special case remains in production without an approved generic exception.
  • Fixed status-specific claim builders are removed or replaced by typed evidence-backed generic behavior.
  • Similar strings in an unrelated repository cannot trigger repository-specific claims.
  • A hidden/renamed holdout demonstrates that generic behavior does not depend on the original literals.
  • The protected independence scanner blocks reintroduction and reports actionable failures.
  • Exceptions are narrow, reviewed, tested outside the qualification repository, and expiring.
  • Critical-fact and unsupported-claim quality is non-inferior on the frozen independent corpus.
  • No benchmark prompt/truth was changed to mask a production regression.
  • All global protected gates pass.

Rollback

Any rollback reintroducing a qualification-specific production rule must also mark affected benchmark evidence invalid and block public generalization claims. Prefer disabling the generic replacement behind a documented feature flag over restoring exact repository knowledge.

Agent handoff

Begin with the full occurrence inventory and commit it to the PR description. Do not modify production behavior until each occurrence has a classification and replacement/removal plan. Report all output differences, hidden-holdout results, scanner coverage, and unresolved generic capability gaps.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions