ci: refresh .test_durations.{unit,integration}#2087
Merged
Conversation
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Aureliolo
added a commit
that referenced
this pull request
May 24, 2026
Pre-PR review (docs-consistency agent) surfaced two valid doc-drift items after PR A landed locally: 1. docs/decisions/0006-tiered-module-size-policy.md Section F row for EPIC #2066 said 'Large (no existing PR in EPIC)'. Updated to reference the four sub-issues now filed (#2092 Foundation, #2093 Stores, #2094 Components, #2095 Pages) and the override-narrowing mechanism. 2. web/CLAUDE.md ESLint section did not document the override- narrowing strategy or the canonical table-driven dispatch pattern that PR A established for the rest of the EPIC. Added a 'Tiered caps + per-bucket ratchet' subsection naming the worked examples in utils/errors.ts, utils/provider-status.ts, hooks/use-list-shortcuts.ts, hooks/useToolbarKeyboardNav.ts, hooks/usePolling.ts, and hooks/useAgentDetailData.ts so PRs B/C/D copy the same pattern. Two pre-existing pre-commit config gaps bundled per the gate- surfaced-fixes rule: 3. .markdownlint.json: disable MD060 (table-column-style). The project already disables MD024/MD030/MD033/MD036/MD041/MD046 for the same content-heavy-tables reason; MD060 fired on every exemption-ledger separator row in docs/decisions/. 4. .codespellrc: skip the .test_durations.{unit,integration} files that landed in #2087. They are auto-generated pytest-durations dumps containing random test names with typo-looking tokens; generated timing data was always meant to be excluded; the skip list missed the file when #2087 tracked it. Pre-reviewed by 4 agents (docs-consistency, comment-quality-rot, frontend-reviewer, issue-resolution-verifier), 2 findings addressed, 1 skipped as no-drift per docs-hygiene rule.
Aureliolo
added a commit
that referenced
this pull request
May 24, 2026
…2092) (#2098) Closes #2092. Part of EPIC #2066. Section F item 11 of `docs/decisions/0006-tiered-module-size-policy.md`. ## Summary First of 4 sub-issues that progressively lift the ESLint override block at `web/eslint.config.js:141-167`. This PR cleans the Foundation bucket (utils + hooks + lib + `cookie-shim.ts`) so the four caps (`complexity: 8`, `max-lines: 400`, `max-lines-per-function: 80`, `max-params: 5`) now apply globally to those paths. The override block grows an `ignores:` list per merged PR; PR D (#2095) deletes the block entirely. **Refactor surface:** 524 production-code violations across ~50 files when the four rules are forced on. PR A handles all of `src/utils/`, `src/hooks/`, `src/lib/`, `src/cookie-shim.ts`: 27 files modified, +2083/-1352. **Canonical pattern (used by every sub-issue):** table-driven dispatch with `Readonly<Record<K, V>>` (optionally `as const satisfies Record<K, V>` for exhaustiveness against an enum/union). Worked examples now documented in `web/CLAUDE.md` "Tiered caps + per-bucket ratchet" subsection. ## Highest-cyclomatic-complexity targets, before/after | Function | Before | After | Mechanism | | --- | ---: | ---: | --- | | `utils/errors.ts::getErrorMessage` | 53 (103 lines) | 5 | Per-status handlers (`_handleRateLimited`, `_handleServiceUnavailable`, `_handleConflict`, `_handleValidation`) + `_handleSpecialisedAxiosStatus` dispatch + status fallback table | | `utils/errors.ts::getCrudErrorTitle` | 19 | 5 | Exhaustive `CATEGORY_TITLES` over `ErrorCategory` + `STATUS_TITLES` | | `lib/error-classify.ts::classifyError` | 17 | 3 | `HTTP_STATUS_CLASSIFIERS` table + `_classifyAxiosError` + `_defaultClassification` | | `utils/fetch-with-retry.ts::fetchWithRetryAfter` | 17 | 7 | `_decideRetryWait` / `_performRetrySleep` / `_shouldKeepRetrying` / `_resolveSignal` | | `utils/logging.ts::sanitizeForLog` | 16 | 7 | `_coerceCap` / `_extractRawString` / `_isAsciiControl` | | `utils/budget.ts::computeBudgetMetricCards` | 14 | 5 | Per-card builders sharing `BudgetCardContext` | | `utils/dashboard.ts::wsEventToActivityItem` | 14 | 3 | Per-field resolvers | | `hooks/use-list-shortcuts.ts` keyboard arrow | 28 | 4 | `KEY_TO_ACTION` dispatch with `ShortcutAction` type | | `hooks/useToolbarKeyboardNav.ts::onKeyDown` arrow | 22 | 4 | `TOOLBAR_INDEX_FNS` direction-fn table + `_hasModifier` / `_isEditableElement` / `_collectToolbarItems` | | `hooks/useCommunicationEdges.ts::fetchAll` | 12 | 4 | `_collectAllMessages` + `_toErrorMessage` | | `hooks/usePolling.ts::usePolling` | 137 lines | <80 | `usePollRefs` sub-hook + `_shouldRunPoll` / `_invokePoll` / `_buildVisibilityHandler` | **Other oversized hooks brought under the cap** via sub-hook extraction: `useDraftPersistence` + `useBeforeUnloadGuard` (in `use-unsaved-changes-guard`), `useDetailStoreSlice` + `useDetailLifecycle` + `useDetailWebSocket` (in `useAgentDetailData`), `useCompanyMutations` + `useCompanyInitialFetch` (in `useOrgEditData`), `useOrgInitialFetch` + `_deriveView` + `_applyCollapse` + `_buildForceView` (in `useOrgChartData`), `_runBatchSave` + `_onBatchSaveError` (in `useSettingsDirtyState`). Sub-hook names start with `use` per rules-of-hooks (no leading underscore). ## Override-narrowing diff ```diff { files: ['src/**/*.{ts,tsx}'], + ignores: [ + 'src/utils/**', + 'src/hooks/**', + 'src/lib/**', + 'src/cookie-shim.ts', + ], rules: { complexity: 'off', /* ... */ }, }, ``` New code under those paths must now respect the four caps. ## Tests - 1100 passing across `__tests__/utils/`, `__tests__/hooks/`, `__tests__/lib/`. Active-handle gate green. - 18 new characterisation tests in `__tests__/utils/errors.test.ts` pin `getErrorMessage` / `getCrudErrorTitle` / `getErrorCode` behaviour BEFORE the splits landed: 422 Pydantic-suppression, 429 + /setup/complete URL hint, 409 + /setup/complete special-case, 409 + DUPLICATE_RECORD / VERSION_CONFLICT structured branches, `1 minute` vs `1 minutes` British plural, HTTP-date `Retry-After` parsing, structured-detail vs plain-string priority for 422, all 7 mapped `ErrorCategory` values + `INTERNAL` fall-through for `getCrudErrorTitle`, 504 transient-connectivity branch. ## Bundled config cleanup (gate-surfaced) Two pre-commit gaps surfaced during this push, fixed in-scope: - `.markdownlint.json`: disabled MD060 (table-column-style). The project already disables MD024/MD030/MD033/MD036/MD041/MD046 for the same content-heavy-tables reason; MD060 fired on every exemption-ledger separator row in `docs/decisions/`. - `.codespellrc`: added `.test_durations.unit,.test_durations.integration` to the skip list. Those generated pytest-durations dumps landed in #2087 and carry random test names with typo-looking tokens; the skip list missed them. ## Review coverage Pre-reviewed by 4 agents (reduced set, per user request, for a web-only Foundation refactor): - **issue-resolution-verifier**: PASS on all 5 acceptance criteria for #2092. - **frontend-reviewer**: 0 findings. Production-ready. All rules-of-hooks preserved (sub-hook names start with `use`), no `any`/unsafe `as`, behaviour preserved across the refactored modules, fetch-with-retry abort-signal short-circuits intact. - **comment-quality-rot**: 0 violations. - **docs-consistency**: 2 MAJOR + 1 MEDIUM. Fixed in commit a28eb6f (ADR-0006 Section F row + `web/CLAUDE.md` ESLint section); skipped 1 no-drift item per `feedback_docs_hygiene`. ## Next PR B (#2093 Stores incl. websocket) starts after this merges. Override `ignores:` gains `'src/stores/**'` then.
Aureliolo
pushed a commit
that referenced
this pull request
May 24, 2026
<!-- HIGHLIGHTS_START --> ## Highlights > _AI-generated summary (model: `openai/gpt-4.1-mini` via GitHub Models). Commit-based changelog below._ ### What you'll notice - New brownfield codebase intake mode supports merger and acquisition scenarios. - Added deep CEO interview feature to improve project charter creation. - Introduced mission control and flight recorder operator cockpit for better operational oversight. - Research mode added for enhanced exploratory work. - Runtime services now log safety-spine state at boot for clearer diagnostics. ### What's new - Research mode feature enables deeper data exploration. - CEO interview integration helps shape project charters. - Mission control and flight recorder cockpit introduced for operational tracking. ### Under the hood - Improved codebase modularity with module-size gates and lint tightening. - Added __init__.py to 21 test directories for better test discovery. - Promoted six transitive dependencies to direct dependencies for clarity. - Split codespell ignore list into vocabulary and source renames. - Decomposed oversized web utilities, hooks, and libraries for maintainability. - Enhanced CI with Lychee link checker integration and retry logic for cosign signing. - Sharded unit and integration tests and added Postgres service container in CI. - Updated infrastructure and web dependencies; maintained lock files. <!-- HIGHLIGHTS_END --> :robot: I have created a release *beep* *boop* --- ## [0.8.8](v0.8.7...v0.8.8) (2026-05-24) ### Features * brownfield codebase intake (merger/acquisition entry mode) ([#2042](#2042)) ([e287621](e287621)), closes [#1975](#1975) * deep CEO interview to project charter ([#2045](#2045)) ([904f2fb](904f2fb)) * mission control + flight recorder operator cockpit ([#2044](#2044)) ([1c2660b](1c2660b)) * research mode ([#2041](#2041)) ([f81a5ac](f81a5ac)), closes [#1989](#1989) * surface safety-spine state in runtime-services boot log (closes [#2096](#2096)) ([#2097](#2097)) ([f187b31](f187b31)) ### Refactoring * add __init__.py to 21 leaf test directories (INP001) ([#2081](#2081)) ([2592118](2592118)), closes [#2064](#2064) * codebase modularity (1/4) - module-size gates + lint tightening + tools ([#2078](#2078)) ([556fbd9](556fbd9)), closes [#2047](#2047) [#2040](#2040) * promote 6 transitive deps to direct deps ([#2083](#2083)) ([adedc6a](adedc6a)) * split codespell ignore-words-list into vocab + source renames ([#2085](#2085)) ([917d98a](917d98a)), closes [#2074](#2074) * **web:** PR A foundation, decompose oversized utils/hooks/lib ([#2092](#2092)) ([#2098](#2098)) ([aedbba5](aedbba5)) ### CI/CD * exclude slsa.dev from lychee (transient timeout on canonical badge) ([#2090](#2090)) ([346c51d](346c51d)) * fix paths-filter shallow-clone race and scorecard allowlist ([#2089](#2089)) ([7cd7ce8](7cd7ce8)) * refresh .test_durations.{unit,integration} ([#2087](#2087)) ([ddf2d86](ddf2d86)) * retry cosign sign on transient GHCR/Rekor failures ([#2100](#2100)) ([da9422a](da9422a)) * shard test-unit + test-integration, sysmon coverage, Postgres service container ([#2080](#2080)) ([0768787](0768787)) * wire Lychee link-checker (workflow + installer + pre-push hook) ([#2084](#2084)) ([1c0694a](1c0694a)) ### Maintenance * Lock file maintenance ([#2086](#2086)) ([a78810a](a78810a)) * Update Infrastructure dependencies ([#2055](#2055)) ([041ad8b](041ad8b)) * Update Web dependencies ([#2054](#2054)) ([4d57b9a](4d57b9a)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: synthorg-repo-bot[bot] <279117679+synthorg-repo-bot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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.
Automated refresh of pytest-split shard-balancing duration files.
Without these files, pytest-split count-partitions tests across shards,
producing badly imbalanced wall-clock times (one shard 55%+ slower than
another in observed runs). This PR captures the latest per-test wall-clock
timings from a clean CI run so the balancer can distribute by total wall
time per group instead.