Skip to content

Release 3.6.4 audit reliability fixes - #2

Merged
sev7enITA merged 1 commit into
mainfrom
codex/release-3.6.4-audit-fixes
Jul 21, 2026
Merged

Release 3.6.4 audit reliability fixes#2
sev7enITA merged 1 commit into
mainfrom
codex/release-3.6.4-audit-fixes

Conversation

@sev7enITA

Copy link
Copy Markdown
Owner

What changed

  • persist policy-discovery jobs with atomic run-token claims and stale-run recovery
  • return controlled validation errors for malformed discovery mutation bodies
  • reconcile onboarding batches transactionally when publication QA fails
  • reuse proposed candidates and audit-log rejected candidate reopening
  • remove continuous device-motion listening from the landing page
  • calculate Observatory countdowns by UTC calendar date
  • bump the application and visible release metadata to 3.6.4

Why

This patch closes all six findings raised by the GitHub auditor against the 3.6.3 Guided Evidence Workflows release. The previous discovery status lived in process memory, onboarding could reject legitimate discovered candidates, and two UI/workflow edge cases could expose stale or incorrect state.

Impact

Migration 20260721120000_policy_discovery_job adds operational discovery-run metadata only. Policy evidence, snapshots, changes, risk analysis, and public-evidence flags are unchanged.

Validation

  • clean npm ci
  • fresh migration and upgrade from tagged v3.6.3
  • 24 test files / 145 tests passing
  • ESLint passing
  • Next.js production build passing
  • seeded-fixture Dataset QA: 50 policies, 0 blockers, 260 expected warnings
  • npm audit --audit-level=high: 0 vulnerabilities
  • clean Hostinger package with no database files

@sev7enITA
sev7enITA marked this pull request as ready for review July 21, 2026 10:10
@sev7enITA
sev7enITA merged commit 0aea020 into main Jul 21, 2026
5 checks passed

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request implements release 3.6.4 audit and reliability fixes, migrating policy discovery jobs from global memory to persistent SQLite storage with atomic run claims, adding safe JSON parsing to prevent server errors, and ensuring transactional QA revalidation rollbacks. It also removes continuous device-motion listeners and corrects Observatory countdowns to use UTC calendar dates. The review comments correctly identify important improvements: adding the missing 'Held' stage to active onboarding stages to prevent duplicate workflows, fixing an edge case where an empty stages array incorrectly marks a batch as failed, and addressing a potential race condition when reading viewport dimensions immediately during orientation changes.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +5 to +11
const ACTIVE_ONBOARDING_STAGES = [
'Proposed',
'OfficialReview',
'BaselinePending',
'QaReview',
'Ready',
] as const;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

The 'Held' stage is missing from ACTIVE_ONBOARDING_STAGES. Since an item in the 'Held' stage is still active in the onboarding workflow (and can be published later), omitting it allows bulk onboarding to target the same candidate again, potentially creating duplicate onboarding items and violating data integrity. Adding 'Held' to the active stages list prevents this issue.

Suggested change
const ACTIVE_ONBOARDING_STAGES = [
'Proposed',
'OfficialReview',
'BaselinePending',
'QaReview',
'Ready',
] as const;
const ACTIVE_ONBOARDING_STAGES = [
'Proposed',
'OfficialReview',
'BaselinePending',
'QaReview',
'Ready',
'Held',
] as const;

Comment on lines +405 to +411
const status = failedItems === stages.length
? 'Failed'
: terminal && failedItems === 0
? 'Completed'
: failedItems > 0
? 'Partial'
: 'Active';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

If stages is an empty array, failedItems === stages.length evaluates to 0 === 0 (which is true), causing the function to incorrectly return a status of 'Failed'. Adding a check to ensure stages.length > 0 before matching the failed count prevents this edge case bug.

Suggested change
const status = failedItems === stages.length
? 'Failed'
: terminal && failedItems === 0
? 'Completed'
: failedItems > 0
? 'Partial'
: 'Active';
const status = stages.length > 0 && failedItems === stages.length
? 'Failed'
: terminal && failedItems === 0
? 'Completed'
: failedItems > 0
? 'Partial'
: 'Active';

Comment thread src/app/page.tsx
Comment on lines 1082 to 1086
const handleOrientation = () => {
if (coarsePointerQuery.matches && window.innerWidth < 920) {
setOnTheGoMotionSuggested(true);
}
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

On mobile browsers (especially iOS Safari), when the orientationchange event fires, window.innerWidth may not have been updated to the new orientation's dimensions yet. Reading it immediately can result in stale values and incorrect layout/suggestion states. Wrapping the check in a short setTimeout ensures the viewport dimensions have fully updated before evaluation.

Suggested change
const handleOrientation = () => {
if (coarsePointerQuery.matches && window.innerWidth < 920) {
setOnTheGoMotionSuggested(true);
}
};
const handleOrientation = () => {
setTimeout(() => {
if (coarsePointerQuery.matches && window.innerWidth < 920) {
setOnTheGoMotionSuggested(true);
}
}, 100);
};

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