Skip to content

Add versioned decision case storage - #19

Draft
falltwo wants to merge 2 commits into
mainfrom
agent/dag-20260912-e15d763a
Draft

falltwo wants to merge 2 commits into
mainfrom
agent/dag-20260912-e15d763a

Conversation

@falltwo

@falltwo falltwo commented Sep 13, 2026

Copy link
Copy Markdown
Owner

This PR adds versioned storage for decision cases. Event evidence, exposure mappings, scenario inputs, and result references are persisted in an isolated SQLite database and remain readable after reconnecting. When scenario inputs change, the service can also identify older results as stale.

Evidence, human overrides, and scenario inputs append a new version instead of replacing history. A persistent BEFORE INSERT trigger blocks INSERT OR REPLACE attempts that reuse either a composite key or a rowid. The protection does not depend on recursive_triggers and works with the older SQLite version used by GitHub Actions.

Authorization continues to use the existing capability model. Each operation resolves the principal again and binds it to the current deployment organization, so an account with the same name in another organization cannot inherit that identity. Missing mappings remain unknown or unmapped; they are never treated as safe.

Testing

  • Decision Case suite: 40 passed
  • Full regression suite: 367 passed
  • Independent SQLite and authorization probes: exit 0
  • Combined with the Scenario branch: 454 passed
  • GitHub Actions: passed

Scope

This change covers case persistence and version protection only. Proposal, approval, receipt, ERP write-back, Streamlit session authorization, MCP, DBOS, ORM integration, and production database migration remain outside this PR.

Persist decision cases, evidence, exposure mappings, append-only input versions, and stale scenario references behind the existing capability boundary.
Use a literal RAISE message so the append-only conflict trigger works on the SQLite version bundled with GitHub Actions Python 3.11.
@falltwo falltwo changed the title feat: add versioned Decision Case persistence service 新增可版本化的決策案例儲存 Sep 13, 2026
@falltwo falltwo changed the title 新增可版本化的決策案例儲存 Add versioned decision case storage Sep 13, 2026
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