SR Method
SR Method EN

Gates and validation

Evidence Gate, Fact Gate, Knowledge Gate, Scope Gate, Verification Gate, Design Gate and Context Budget Gate.

Gates and validation

A gate is a control. It prevents Codex from moving forward on an assumption or delivering without evidence.

Main gates

GateGoalConcrete application
Evidence GateVerify sources before planning.RepoMap or KG -> candidate files -> real code reading -> tests/logs.
Fact GatePrevent unproven factual conclusions.If Codex can verify in repo, logs, tests or official docs, it must verify before asserting.
Knowledge GateBuild the change map.Read CODEBASE_MAP.md, then real files. In Nexus mode, KG guides but real code decides.
Scope GateStay inside lot scope.No dependency, migration, webhook, cron or CORS relaxation without validation.
Verification GateProve the change works.Run useful commands or document why impossible.
Design GateControl UI/UX quality.Required for any non-trivial UI.
Context Budget GatePrevent context loss.Create NEXT_SESSION_PROMPT.md when session becomes risky.

SR Core and SR Nexus KG

In SR Core mode, Codex relies on CODEBASE_MAP.md, SR files and direct code reading.

In SR Nexus KG mode, a Nexus Knowledge Graph can help identify files, routes, components, services, dependencies, tests and risk areas.

The KG guides the search, but never replaces reading real code. If KG and code diverge, real code wins.

Bad and good Fact Gate

Bad:

It is probably a display issue.

Good:

I checked src/pages/Dossier.tsx and api/dossiers.ts. The backend returns status, but the component displays legacyStatus. The verified cause is therefore frontend mapping.

If Codex has not verified:

Fact Gate not satisfied: I must read <source> before concluding.

Context command

The user normally does not need to run it manually. Codex should run it when the session gets long, several lots have been chained, a large lot just ended or context seems confused.

python3 scripts/codex/context_budget_report.py --root . --compact
StatusExpected behavior
greenCodex can continue. No need to mention it unless asked.
yellowCodex can continue, but should be careful if the next task is long.
orange / redCodex must prepare NEXT_SESSION_PROMPT.md and recommend a new conversation.
stale / ambiguous / unknownThe report is unreliable. Codex must secure resume.

Strict human validation

Codex may analyze before validation. But file changes, publication, push, migration, dependency, configuration, destructive action or business change requires explicit scope validation.

On this page