Skip to content

Helpers that must not fail a check still miss sqlite3 errors (#2425) #2825

In review

Description

@abrichr

On main 08bc9fc19, the helpers that #2425 describes as unable to fail a check still catch only a narrow set of exceptions. Grok reported this in review, and it was not fixed before merge.

Problems

  • enforcement.py lines 179 and 183 catch only (OSError, TypeError, ValueError), with the comment "the log never changes a verdict".
  • verifier.py await_effects (starting around line 1926) catches only (OSError, RuntimeError, ValueError, TypeError, KeyError, AttributeError).

sqlite3.OperationalError (for example "database is locked") derives from sqlite3.Error, which is not in either tuple, so a locked log or effect database can still raise out of a helper that is meant to be side-effect-only.

Expected

  • Logging helpers: must never change a verdict. Catch Exception and record the failure.
  • Effect readers: must fail closed, so the step is UNCERTAIN or refused, never passed.

Tests

For each helper, make the underlying store raise sqlite3.OperationalError. Check that the verdict is unchanged for the log helper, and that the outcome is uncertain or refused, never a pass, for await_effects.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions