Fix dependency issue#46
Merged
Merged
Conversation
|
|
zcor
added a commit
to zcor/hound
that referenced
this pull request
Jun 1, 2026
scabench-org#46) My previous fix (scabench-org#45) added a check for payload.get("admin_preview") but get_current_user_from_token() strips the JWT payload down to {user_id, tenant_id} and discards custom claims — so the check always saw None and we still 401'd. Switch to decode_access_token() which returns the full payload. This is the same approach used by reject_preview_writes() in auth_utils.py (and CLAUDE.md gotcha #admin-preview documents the trap). Verified with a fresh preview JWT after deploy: /users/me returns 404 (was 401), preview banner persists across /audits/repo-27 navigation. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zcor
added a commit
to zcor/hound
that referenced
this pull request
Jun 1, 2026
scabench-org#48) * feat(deep-audit): admin_verified gate on curated overview (firepan-oi4) Adds admin_verified: bool to the deep_audit_overview JSONB, defaulting to False for all newly finalized audits. Also surfaces the flag on ScanHistoryItem so the frontend can gate the assessment_level badge and credible-findings count until a human or stronger-model verifier signs off on the curated assessment. The yieldnest scan 77 incident showed that rendering DeepSeek's own summary + assessment_level + risk_score directly to a paying prospect is an anti-demo on every free-tier deep audit. This is the bleed-stopper half of that fix (backend). Frontend half is in firepan-labs/app. Legacy rows without the key are treated as unverified on read-path; no migration required. Beads: firepan-oi4 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(deep-audit): admin verify endpoints + SQLAdmin actions (firepan-oi4) Wires the admin_verified flag added in the previous commit: - POST /admin/scans/{execution_id}/verify-overview and /unverify-overview (X-Admin-Key only, matches finalize_scan pattern). Flipping reassigns the whole JSONB dict because JSONType has no MutableDict hook — in-place mutation would not commit. - SQLAdmin actions on ScanExecutionAdmin ("Verify Overview" / "Unverify Overview") so an admin reviewing a finished deep audit can flip the flag with two clicks from the UI. - Verified status surfaced as a badge column on the ScanExecution admin list view (verified / pending / none) so admins can spot unverified deep audits at a glance. Verify action stamps verified_at (ISO UTC) + verified_by ("admin") into the JSONB. Unverify strips both. Both endpoints idempotent on their respective target state. tests/test_deep_audit_verify.py covers: - _compute_deep_audit_overview defaults admin_verified=False. - verify/unverify flip the flag, stamp the trail, and require admin. - ScanHistoryItem surfaces admin_verified correctly. - Legacy rows without the key render as unverified (backfill safe). Beads: firepan-oi4 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(ruff): fix I001 on admin-preview inline imports (firepan-oi4) Pre-existing lint drift from PR scabench-org#46 — ruff wants grouped imports. No semantic change: both imports already local to the function, just adjacent now with the comment block above them. Unblocks CI for the oi4/ygy stack. Beads: firepan-oi4 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
zcor
added a commit
to zcor/hound
that referenced
this pull request
Jun 1, 2026
… (firepan-1bg) (scabench-org#51) Lets admins re-run deep audits on behalf of paying customers without burning their own monthly quota, and collapses the manual "delete AuditSession + ScanExecution in SQLAdmin to refund a stalled audit" workflow (CLAUDE.md scabench-org#46) into a single POST. Motivated by the Egorov 2026-04-23 FeeDistributor thread — we need to keep the dashboard pipeline running through the same code path the worker already uses. Changes - tier_enforcement._check_sync: new bypass_quota kwarg skips monthly-limit and credit enforcement. Still requires tenant to exist. Reserved for admin-authenticated callers — never reachable from tenant-facing paths. - POST /admin/audits/force-run: admin-only (X-Admin-Key header, no JWT, no session cookies, no query-param auth — matches the verify-overview CSRF gate). Creates AuditSession + ScanExecution exactly like /audits/start so the dashboard and websocket progress path stay unchanged; stamps admin_forced=True into both scan_config and AuditSession.models for auditability. - POST /admin/audits/{session_id}/refund: deletes AuditSession + matching ScanExecution. Tolerates orphan rows (one side missing); 404 only when both are absent. Quota count drops the moment the row is gone. Tests - 13 new tests cover bypass_quota marker, force-run auth gates (missing key, wrong key, session-cookie reject, 404 on unknown project), worker dispatch + row creation, repo_url fallback to project.git_url, refund happy-path + orphan-tolerance + quota-slot release. - Full suite still passes; 4 pre-existing telegram failures are stale "Deep Audit Complete" vs "Deep Scan Complete" strings from h7u rename, unrelated to this change. Unblocks firepan-nxf (file-scoped deep audit), which is filed but waiting on this to ship first. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.