Skip to content

fix(E0): prevent unverified outcomes leaking into cross-repo learning - #985

Closed
hyperpolymath wants to merge 2 commits into
mainfrom
fix/cross-repo-qualified-evidence-e0
Closed

hyperpolymath wants to merge 2 commits into
mainfrom
fix/cross-repo-qualified-evidence-e0

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

E0 event-chain dependency: cross-repository learning must share the outcome evidence gate

Companion to #982 and event-chain #984.

Prior CrossRepoLearning logic counted every outcome: "success" as a success in local confidence, transfer source selection, the indexed counters and anomaly computations, even when OutcomeTracker had explicitly excluded the same event as unverified or scan_failed. That means a stopped false-learning path in one component could reappear from another.

This separate scoped PR changes these data consumers to use Hypatia.OutcomeTracker.qualified_outcome?/1, the same evidence qualification used by the main outcome tracker:

  • Local and transferred success counts use only warranted events.
  • Unqualified attempts no longer satisfy the three-outcome threshold to transfer evidence into a different repository.
  • The cached transfer index and alert calculation do not treat legacy unverified success strings as corroboration.
  • Adds planted-negative and positive evidence qualification fixtures in test/cross_repo_learning_test.exs.

No Python, new vector store, login, model redesign, automatic repair authorisation or unrelated repo modification.

Merge-readiness status: DRAFT / IN_PROGRESS

  • Pinned mix format --check-formatted and mix test test/cross_repo_learning_test.exs run and pass on this head.
  • Audit other uses of the cached index and anomaly denominators; verify that excluding unqualified observations is compatible with consumers. The raw append-only log remains the audit record.
  • Current-head required CI, security, governance, K9/DEED, Hypatia and app review evidence checked.
  • All substantive app comments resolved with fixes or justified responses; Verified signatures enforced.
  • Companion fix: stop replay and false success in fleet learning ingestion #982's durable ingestion and replay semantics pass before claiming end-to-end E0 closed.

The PR is not a claim that the whole event chain is implemented, validated or safely deployable.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 72351c96-162f-46ec-b6ab-263c4c7653fb
Commits

Reviewing files that changed from the base of the PR and between 85aa3a4 and db318e6.

Files selected for processing: 2
  • lib/cross_repo_learning.ex
  • test/cross_repo_learning_test.exs
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • 🔴 Error committing to branch - (🔄 Check to retry)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review October 31, 2026 00:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T00:04:52.591768Z db318e6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Owner Author

Superseded by draft PR #986, which is correctly stacked on PR #982's branch. This PR's initial base was main, where the required OutcomeTracker.qualified_outcome?/1 contract does not yet exist; the mix compile --warnings-as-errors E2E job correctly caught the undefined function. Rebuilt the exact two-file change on #982's head instead of duplicating the evidence rule or weakening CI. Closing this branch's PR unmerged; no scientific/learning semantics were claimed verified here.

auto-merge was automatically disabled October 31, 2026 00:03

Pull request was closed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db318e6258

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# --- Public API ---

@doc false
def qualified_rows(rows) when is_list(rows), do: Enum.filter(rows, &Hypatia.OutcomeTracker.qualified_outcome?/1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the missing outcome qualification API

When any stored outcome is processed, this callback invokes Hypatia.OutcomeTracker.qualified_outcome?/1, but that function is not defined anywhere in this commit's tree (a repo-wide search finds only these new callers); the new test also calls an absent qualified_outcome_counts/1. Consequently non-empty calls to repo_confidence/3, repos_with_fix/1, anomaly detection, or index rebuilding raise UndefinedFunctionError instead of qualifying evidence. Include the companion OutcomeTracker implementation in this change or avoid depending on an unavailable API.

Useful? React with 👍 / 👎.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

❌ Failed to create Coding Agent finishing-touch task. Please try again.

hyperpolymath added a commit that referenced this pull request Oct 31, 2026
…(stacked on #982) (#986)

## Stacked E0 consumer, **base: PR #982's event-ingestion branch**

This PR depends on
[#982](#982) and
[event-chain #984](#984).
It uses `OutcomeTracker.qualified_outcome?/1` **from its actual base**
rather than duplicating the epistemic rule.

- Apply the same postcondition qualification to cross-repository local
confidence, transferred confidence/repo eligibility, cached outcome
indexes, and anomaly evidence.
- Add positive and planted-negative Elixir tests that exclude legacy and
scan-failed `success` records.
- Preserve unqualified attempts in the original audit log; they do not
increase confidence or dispatch maturity.
- No Python, new external store, vector DB, or multi-user system.

### Status: DRAFT / NOT READY

- [ ] #982 corrections, CI and review complete at its own current head;
do not merge this before #982.
- [ ] `mix format --check-formatted`, Elixir integration tests,
current-head governance/security checks and bot conversations pass on
this stacked head.
- [ ] Demonstrate cross-repo outcomes cannot turn unqualified events
into apparent successes; test real data boundary and index consumers.
- [ ] All commits Verified under repo policy before presentation as a
completed draft.
- [ ] After #982 merges, rebase this PR onto refreshed main and
revalidate actual head.

Supersedes #985, which mistakenly targeted main despite depending on the
#982-only qualification function. That branch was not a valid standalone
integration and will be closed unmerged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant