Skip to content

fix(gates): strict-by-install Action + pre-commit, robust sticky scorecard (F3/F8) - #29

Merged
SollanSystems merged 2 commits into
mainfrom
fix/gate-strictness
Jul 5, 2026
Merged

SollanSystems merged 2 commits into
mainfrom
fix/gate-strictness

Conversation

@SollanSystems

Copy link
Copy Markdown
Owner

Summary

Closes external-review findings F3 and F8: the shipped gate surfaces (GitHub Action, pre-commit hook) silently ran structural-fallback validation, and the Action's scorecard step was fragile.

  • F3 — strict by install on the gate surfaces (the CLI's pure-stdlib structural default is deliberate and unchanged):
    • action.yml installs [schemas,yaml] extras in both install paths (PyPI-versioned and action-checkout). The local-path-with-extras pip syntax was proven in a scratch venv, and an independent verifier reproduced the proof — strict mode catches a type-invalid contract (plan_version as string) that the fallback misses.
    • .pre-commit-hooks.yaml loop-doctor hook declares additional_dependencies: [jsonschema>=4, pyyaml>=6], pinned by test.
  • F8 — scorecard robustness:
    • The embedded heredoc moved to a unit-tested scripts/action_scorecard.py; fail-under-score is validated as an integer 0–100 with a clear ::error instead of an int() traceback.
    • The PR comment is now sticky: a <!-- loop-engineer-scorecard --> marker is embedded and the step updates the existing comment instead of posting a new one each run. Still non-fatal on API failure.
  • Docs state honestly that the inspect score is an advisory heuristic (gameable by a determined author) and loop doctor is the hard gate.

Test plan

  • fallback mode: 272 passed, 11 skipped / jsonschema mode: 277 passed, 6 skipped
  • scorecard script unit-tested incl. "80.5"/"abc"/"" inputs
  • action.yml yaml-lints; referenced files exist at github.action_path in both install modes
  • independent adversarial verifier PASS

🤖 Generated with Claude Code

SollanSystems and others added 2 commits July 5, 2026 18:27
…idation runs

The GitHub Action installed the bare package (no [schemas] extra) on both
install paths and the pre-commit loop-doctor hook declared no deps, so both
gate surfaces ran loop/contract.py's pure-stdlib structural fallback — a
type-invalid contract passed the shipped gates. The CLI's structural default
is deliberate and unchanged; strictness now lands by-install on the gates only.

- action.yml: both paths install "loop-engineer[schemas,yaml]" (PyPI-pinned and
  action-checkout). Local-path-with-extras syntax proven in a scratch venv.
- action.yml doctor step asserts the report's validation_mode is "jsonschema"
  so a future packaging regression that drops the extras fails loudly.
- .pre-commit-hooks.yaml: additional_dependencies jsonschema>=4, pyyaml>=6.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The scorecard lived in an inline action heredoc that did int(sys.argv[2]) — a
non-integer fail-under-score ("80.5"/"abc") tracebacked instead of failing
cleanly — and the PR-comment step POSTed a fresh comment every run.

- Extract the logic to scripts/action_scorecard.py (invoked from the action
  checkout at github.action_path). It validates fail-under as an integer 0-100
  and emits a clear ::error with a distinct exit code (2) on bad input, separate
  from the fail-under-breach code (1); same summary/scorecard.md/warning/
  fail-under behavior otherwise. TDD-covered in test_action_scorecard.py.
- Sticky PR comment: the rendered body carries a <!-- loop-engineer-scorecard -->
  marker; the comment step finds that comment and PATCHes it in place, else
  POSTs. Stays non-fatal on API failure.
- Document honestly (fail-under-score input + README): the inspect score is an
  advisory heuristic and can be gamed; loop doctor is the hard gate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 5, 2026 22:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@SollanSystems
SollanSystems merged commit fbf06fb into main Jul 5, 2026
6 checks passed
@SollanSystems
SollanSystems deleted the fix/gate-strictness branch July 5, 2026 22:55
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