Skip to content

feat(tuner): authorize final Content and Trigger revisions - #1014

Merged
guangyu-reflexio merged 2 commits into
mainfrom
feat/trigger-v5-native-contract
Nov 13, 2026
Merged

guangyu-reflexio merged 2 commits into
mainfrom
feat/trigger-v5-native-contract

Conversation

@guangyu-reflexio

@guangyu-reflexio guangyu-reflexio commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Allow the maintained offline tuner to propose one explicit final Content/nullable Trigger pair, including a Trigger-only repair when Content is already correct. Session diagnosis and the global Content audit remain; a source-only Trigger gate and conditional single-source builder bind their results to the exact accepted Content artifact and original source. Separate admitted component identities and completed invocation receipts let the independent authorizer reconstruct the final revision.

The same final pair feeds the versioned search projection, atomic SQLite successor/index/lifecycle publication, rollback and retry. Historical content-only records retain their decoder/semantics; current composition has one maintained method. No second worker, baseline router or unaccounted model fallback is added.

Merged as f526b6c2 on 2026-11-13. Reviewed/tested head 6f72914a (base 67b84f79) has exactly the merged SDK Git tree. All 1,780 composed tests passed with no skips/failures, including the overlapping 153 changed-surface checks. Ruff/format and runtime/test Pyright passed. Both standard local Codex and complementary detached adversarial review clear. Fourteen CI checks passed; optional CodeRabbit had no posted findings and was cancelled on merge. No admin/guard bypass.

The bounded native Trigger-profile result below is now complete. Its frozen SDK source 52c4244d remains the actual scientific source; all 16 component resources and relevant native LLM/tuner/rule-evidence source directories are unchanged in this transfer. Engineering checks do not establish production or whole-tuner efficacy. No experimental model inference was rerun during transfer; no production action occurred.

Completed native Trigger-profile comparison — 2026-11-13

The exact-source comparison is complete: SDK 52c4244d, Enterprise 554b2dbb, Labs fd32b11f. Nineteen inference-eligible cases plus two exact-preservation controls and one missing-Content refusal all completed. Two context-isolated, arm-blind MiniMax channels report 7 wins / 0 losses / 12 ties and 8 wins / 0 losses / 11 ties against unchanged Trigger. Both registered assessor controls pass in both channels. Original-source audit supports all eight revisions; the conservative headline withholds the sole disputed gain. This is a bounded exposed-synthetic Trigger-component lead, not whole-tuner, search or online efficacy proof.

Generation used 28 requests (including one bounded corrective retry). An assessment-only thinking-profile repair reused all actors; eight final blind assessment calls completed. Zero-call citation normalization recovered three batches while preserving every judgment/reason/map. The failed reasoning-heavy assessment and one interrupted reservation remain charged: 38/48 total reservations,37 confirmed responses,1 uncertain usage;64,744 observed input/31,366 output tokens. Candidate generation:104.33 summed call seconds; assessment/failure time is separately reported. The study closed at 332.14/360 total counted minutes including 292.50 preparation minutes;10 unused requests retired. No production action.

Rich report and complete sensitivity/accounting. Results commit 72a43331 passed local Codex review with no actionable findings. Its scoped clearance does not clear the entire historical Labs PR #448. Existing native engineering, protected-review and release gates remain; draft is not deployment authorization.

Summary by CodeRabbit

  • New Features
    • Playbook optimization can now revise consultation triggers alongside playbook content, using source-grounded checks and preserving triggers when evidence does not support a safe change.
    • Published revisions can update content, triggers, or both, with search projections reflecting the final version.
  • Reliability
    • Added validation and recovery checks for trigger revisions and publication, including protection against mismatched or incomplete results.
  • Documentation
    • Added guidance on trigger maintenance and final-version publication.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The change adds native Trigger maintenance to the open-world rule-evidence flow. It introduces v2 authority, artifacts, replay checks, and SQLite authorization for Trigger stages. Publication now supports final revisions that change content, the trigger, or both, while retaining the existing candidate-projection path.

Changes: Trigger Maintenance and Final-Version Publication

Layer / File(s) Summary
Define and validate Trigger maintenance
reflexio/server/services/playbook/rule_evidence/trigger_maintenance.py, reflexio/server/services/playbook/rule_evidence/trigger_gate.md, reflexio/server/services/playbook/rule_evidence/trigger_build.md, reflexio/server/services/offline_tuner/open_world/trigger_qualification.py, tests/server/services/playbook/test_trigger_maintenance.py
Trigger maintenance defines source frames, gate and builder contracts, request validation, and the flow that preserves or revises a trigger. Qualification fixtures and tests cover its structural checks.
Bind Trigger stages to v2 attempts
reflexio/server/services/offline_tuner/open_world/{models.py,analyst.py,rule_evidence_authority.py,rule_evidence_runtime.py,rule_evidence_v2.py}, reflexio/server/services/offline_tuner/evidence/open_world_models.py, reflexio/test_support/open_world_attempt_contract.py, tests/server/services/offline_tuner/open_world/*, reflexio/server/services/playbook/rule_evidence/README.md
The v2 authority binds gate and builder identities to their implementation, prompts, schemas, and qualification receipt. Runtime and attempt completion record content and Trigger artifacts, then reconstruct and verify publication inputs. Tests cover invocation, replay, and qualification behavior.
Add SQLite v2 storage and authorization
reflexio/models/api_schema/domain/entities.py, reflexio/server/services/offline_tuner/open_world_records.py, reflexio/server/services/storage/sqlite_storage/{_base.py,_open_world.py,_open_world_attempt.py,_open_world_trigger.py}, tests/server/services/storage/test_sqlite_trigger_v2_schema.py, reflexio/test_support/open_world_attempt_contract.py
SQLite schemas and migrations admit Trigger roles and result artifacts. The v2 authorization mixin validates authority, artifact fields, source bindings, dependencies, and replayed results. Storage tests exercise migration and authority validation.
Bind final revisions to search and publication
reflexio/server/services/playbook/revision.py, reflexio/server/services/offline_tuner/search_projection.py, reflexio/server/services/offline_tuner/open_world/publication.py, reflexio/server/services/playbook/publication.py, reflexio/server/services/storage/sqlite_storage/_open_world_publication.py, reflexio/test_support/open_world_publication_contract.py, tests/server/services/offline_tuner/test_search_projection.py, tests/server/services/playbook/test_provisional_publication_contract.py
Final-version projection and publication contracts bind the revised content and trigger to v2 proofs and durable publication. Existing candidate projections retain their v1 path. Tests cover projection parsing, revision bindings, publication retries, and failure cases.

Estimated code review effort: 5 (Critical) | ~100 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RuleEvidenceRuntime
  participant TriggerMaintenance
  participant SQLiteOpenWorldAttemptMixin
  participant RuleEvidenceV2
  RuleEvidenceRuntime->>TriggerMaintenance: Invoke gate and builder stages
  TriggerMaintenance->>RuleEvidenceRuntime: Return validated Trigger result and receipts
  RuleEvidenceRuntime->>RuleEvidenceV2: Finish v2 attempt
  RuleEvidenceV2->>SQLiteOpenWorldAttemptMixin: Write content, Trigger, candidate, and decision artifacts
  SQLiteOpenWorldAttemptMixin->>RuleEvidenceV2: Verify artifacts and replay receipts
Loading
Merge Risk: Low · up to 6f729

The change looks functionally sound from the supplied evidence. Two tests guarding the new authorization checks and the SQLite invocation-table migration are weaker than their names suggest, so a regression could slip through. Tighten them before or soon after merge.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@guangyu-reflexio guangyu-reflexio changed the title feat(tuner): add source-bound Trigger maintenance component feat(tuner): authorize final Content and Trigger revisions Nov 12, 2026
@guangyu-reflexio
guangyu-reflexio force-pushed the feat/trigger-v5-native-contract branch from acca16d to 52c4244 Compare November 12, 2026 22:03
@guangyu-reflexio
guangyu-reflexio force-pushed the feat/trigger-v5-native-contract branch from 52c4244 to 6f72914 Compare November 13, 2026 06:37
@guangyu-reflexio
guangyu-reflexio marked this pull request as ready for review November 13, 2026 06:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T06:39:35.104619Z 6f72914 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-13T06:42:30.403660Z 6f72914 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.

@guangyu-reflexio
guangyu-reflexio merged commit f526b6c into main Nov 13, 2026
14 of 15 checks passed
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