Skip to content

Add classifier fail-closed policy foundation#51

Merged
yanny-sec merged 4 commits into
secureagentics:mainfrom
Muhammad-usman92:classifier-fail-closed-foundation
Jun 18, 2026
Merged

Add classifier fail-closed policy foundation#51
yanny-sec merged 4 commits into
secureagentics:mainfrom
Muhammad-usman92:classifier-fail-closed-foundation

Conversation

@Muhammad-usman92

Copy link
Copy Markdown
Contributor

Summary

Adds the status-first foundation for classifier failures. Classifier outages are now represented as ERROR verdicts with empty MAD codes, backed by additive proto fields, generated bindings, ledger-tracked migrations, store/API support, and engine error semantics that no longer fabricate benign M0 results.

Test plan

  • go test ./... from backend
  • Migration runner tests, including double-run safety
  • Populated DB upgrade test for verdict table rebuild
  • Engine classifier failure tests

Checklist

  • CLA signed
  • Tests pass locally
  • Docs updated where needed
  • British English; no em-dashes; no marketing fluff

@yanny-sec

Copy link
Copy Markdown
Contributor

The PR looks good so far. A few things:

  • The new migration is destructive so I'd like a test that are run against embedded migration (migrations.Files) to a DB that's in the pre 002 migration state with data in it
  • Make the migration safe to re-run if the process is killed mid-way. The next run shouldn't fail at "column already exists"
  • setup.py uses interpolation instead of parameterisation. For security and consistency with the Go code, let's make it use parameters.

@Muhammad-usman92

Copy link
Copy Markdown
Contributor Author

The PR looks good so far. A few things:

  • The new migration is destructive so I'd like a test that are run against embedded migration (migrations.Files) to a DB that's in the pre 002 migration state with data in it
  • Make the migration safe to re-run if the process is killed mid-way. The next run shouldn't fail at "column already exists"
  • setup.py uses interpolation instead of parameterisation. For security and consistency with the Go code, let's make it use parameters.

Thanks for the feedback,

I added embedded migration tests for a populated pre-002 DB, made migration 002 recover cleanly after an interrupted run, and switched setup.py to parameterized queries.

yanny-sec
yanny-sec previously approved these changes Jun 17, 2026
@yanny-sec

Copy link
Copy Markdown
Contributor

@Muhammad-usman92 please run ruff format scripts/setup.py and re-commit

@Muhammad-usman92

Copy link
Copy Markdown
Contributor Author

@Muhammad-usman92 please run ruff format scripts/setup.py and re-commit
Done @yanny-sec

@yanny-sec yanny-sec merged commit 5fc7214 into secureagentics:main Jun 18, 2026
1 check 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.

2 participants