Skip to content

Add auditable research candidate promotion policy - #97

Merged
Techris93 merged 1 commit into
mainfrom
codex/research-promotion-policy
Jul 29, 2026
Merged

Add auditable research candidate promotion policy#97
Techris93 merged 1 commit into
mainfrom
codex/research-promotion-policy

Conversation

@Techris93

Copy link
Copy Markdown
Owner

Adds the durable Core policy required by Mission Control discovery automation.

  • disabled by default
  • deterministic score/evidence/publisher gates
  • preview before apply
  • draft-case creation only; no malicious verdict
  • promotion event and policy provenance retained
  • CLI and documentation

Verification: 453 Core tests and 4 subtests passed; focused promotion tests passed.

@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: 6145bd4f38

ℹ️ 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".

decisions: List[Dict[str, Any]] = []
for candidate in candidates:
evidence = candidate.get("evidence") if isinstance(candidate.get("evidence"), dict) else {}
evidence_refs = [key for key in ("metadata_url", "artifact_url", "publisher") if evidence.get(key)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Exclude publisher metadata from the evidence-reference count

When a scored feed event has a metadata URL and an author/publisher but no artifact URL, the default minimum_evidence=2 gate passes because publisher is counted as a reference. score_pending_events() commonly creates exactly this shape when the registry leaf URL is metadata rather than an artifact, so candidates can be promoted with only one actual evidence reference; publisher presence should remain the separate require_publisher gate described by the policy.

Useful? React with 👍 / 👎.

Comment on lines +576 to +578
if apply and eligible and policy["mode"] == "draft_case" and not candidate.get("case_id"):
from secopsai.research_cases import add_evidence, add_subject, create_case
case = create_case(title=f"Investigate {candidate['ecosystem']} package {candidate['package']}", summary=f"Automatically promoted as a draft investigation after deterministic policy checks. Similarity score: {candidate['score']}. This is a lead, not a maliciousness verdict.", case_type="typosquatting", severity="medium", confidence=min(int(float(candidate["score"])), 80), owner=actor, metadata={"candidate_id": candidate["candidate_id"], "promotion_policy": policy}, db_path=db_path)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Claim each candidate before creating its promotion case

When two --apply invocations overlap, both can read the same candidate as new and pass this check before either updates it. Each invocation then commits a separate case, subject, and evidence record; the later update wins the candidate's case_id, while the unique promotion event retains only one of the two case IDs, leaving an orphan case and inconsistent audit history. Atomically reserve the candidate with a conditional status update before creating the case, or make the entire promotion operation transactional.

Useful? React with 👍 / 👎.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying secopsai with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6145bd4
Status: ✅  Deploy successful!
Preview URL: https://e4ebe7d5.secopsai.pages.dev
Branch Preview URL: https://codex-research-promotion-pol.secopsai.pages.dev

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6145bd4
Status: ✅  Deploy successful!
Preview URL: https://4414110d.website-bks.pages.dev
Branch Preview URL: https://codex-research-promotion-pol.website-bks.pages.dev

View logs

@Techris93
Techris93 merged commit 46b6a5b into main Jul 29, 2026
15 checks passed
@Techris93
Techris93 deleted the codex/research-promotion-policy branch July 29, 2026 00:18
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