Repository navigation
Conversation
nc9
force-pushed
the
fix/report-status-helpers-1662
branch
from
November 10, 2026 11:13
8a2d2dd to
b82b323
Compare
nc9
marked this pull request as ready for review
November 10, 2026 11:13
nc9
force-pushed
the
fix/report-status-helpers-1662
branch
from
November 11, 2026 00:22
b82b323 to
1fd4f12
Compare
…tial rule for live and rebuilt reports #1662 Signed-off-by: Nik Cubrilovic <[email protected]>
Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/report-status-helpers-1662
branch
from
November 11, 2026 00:23
1fd4f12 to
79f3ae5
Compare
This was referenced Nov 11, 2026
Contributor
Author
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.
Closes #1662
What
isAuditFailed(status)andisScoreless(status)sit besideauditStatusToLifecyclein core-contracts, which now uses them.failedandblockedare failed;partialand an absent status are not. They replace the open-codedstatus === "failed" || status === "blocked"(and its negation) in the JSON, LLM, markdown, text and HTML renderers,locked-rules,waf-blocked,grouping, the console renderer,fail-on, the MCP billed audit and the engine'sreport-stream(whose privateisScorelessStatusis gone).isScorelessis the same set today and a separate name for the N/A-score sites, so a status that fails but keeps a score changes one place.withMaxDurationCut(run, cut)inreports/reconstruct.tsis the one place a--max-durationcut makes acompleted(or status-less) runpartial, with the cut's reason and themax_durationcode. The live audit (controllers/audit.ts) and the rebuild from the stored scope (reconstructReport) both call it. It is applied after the smart-audit carried-page override rather than insidederiveCrawlRunStatus: that override resets the status tocompleted, so a cut applied inside the derivation would be swallowed.No output changes: statuses, reasons and codes are what they were.
Acceptance criteria
isAuditFailed/isScorelessexist next toauditStatusToLifecycleand replace the open-coded checks. Left as they are:commands/audit.tslines that the exit-code change (squirrel audit: exit code and outcome come from 34 scattered assignments; one precedence function, outcome in JSON #1657 / the exit code PR) deletes, andcoverage.ts, which asks forfailedalone (a redirect failure), not failed-or-blocked.squirrel reportrebuild. It sits besidederiveCrawlRunStatusand not inside it, for the ordering reason above.apps/cli/tests/reports/max-duration-status-1662.test.ts: a 7-row table for the function, plus a stored crawl rebuilt withreconstructReportcompared with the live call).Characterization first
apps/cli/tests/reports/rebuilt-max-duration-status-1662.test.tspins the rebuild (a crawl with no cut has no status stamped; one with a recorded cut ispartialwith the cut's reason andmax_duration). It was run against the oldreconstruct.tsand was green before the change.packages/core-contracts/tests/audit-status-1662.test.tstables the predicates andauditStatusToLifecycleover every status,nullandundefined.Also run by explicit path, unchanged: report json-status, llm-status, html-status, max-duration-partial-1271, locked-rules-coverage, failure-notice, passed-rules, failure-reason-renderers; the CLI fail-on, max-duration, fail-on-timed-out-security-970, mcp max-duration and billed-audit-summary, reconstruct-page-rule-counts-1260 and the audit-max-duration e2e; the engine's report-stream-v2 and streaming-scoring goldens.
tsgoinapps/cli,packages/report,packages/audit-engine,packages/core-contracts; root lint;bun run format:checkinapps/cli;make validate.Notes
JSON_REPORT_SCHEMA_VERSIONis untouched.commands/audit.ts; the lines this one leaves alone are the ones that PR removes, so they should not conflict.grouping.ts'sreportPassedRulesparameter is now typedstatus?: AuditStatus(wasstring) so it can use the predicate.