Repository navigation
refactor: Centralize Admin authenticated JSON transport - #29
sidneyswift wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
There was a problem hiding this comment.
1 issue found across 17 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tests/adminRequests.test.mjs">
<violation number="1" location="tests/adminRequests.test.mjs:1">
P2: Custom agent: **Enforce Clear Code Style and Maintainability Practices**
This new file is 209 lines, more than double the 100-line cap in the style guideline, and it bundles three distinct test concerns into one file: request-shape assertions for all 11 adapters, error-precedence/fallback assertions, and standalone edge-case tests. Split the edge-case tests and part of the adapter cases into separate files so each file stays under 100 lines.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| @@ -0,0 +1,209 @@ | |||
| import assert from "node:assert/strict"; | |||
There was a problem hiding this comment.
P2: Custom agent: Enforce Clear Code Style and Maintainability Practices
This new file is 209 lines, more than double the 100-line cap in the style guideline, and it bundles three distinct test concerns into one file: request-shape assertions for all 11 adapters, error-precedence/fallback assertions, and standalone edge-case tests. Split the edge-case tests and part of the adapter cases into separate files so each file stays under 100 lines.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At tests/adminRequests.test.mjs, line 1:
<comment>This new file is 209 lines, more than double the 100-line cap in the style guideline, and it bundles three distinct test concerns into one file: request-shape assertions for all 11 adapters, error-precedence/fallback assertions, and standalone edge-case tests. Split the edge-case tests and part of the adapter cases into separate files so each file stays under 100 lines.</comment>
<file context>
@@ -0,0 +1,209 @@
+import assert from "node:assert/strict";
+import { afterEach, test } from "node:test";
+import { API_BASE_URL } from "../lib/consts.ts";
</file context>
Summary
Share HTTP/Bearer/JSON error policy across 11 resource adapters while preserving each response shape, query and historical error precedence. Move sandbox fetcher into the owning recoup domain.
Verification
25 original parity checks pass against old/new adapters; the expanded 27-test suite passes after review; typecheck and production build pass. Test harness requires Node 24; application behavior unchanged. Independent review completed.
Scope and review
Part of the user-requested Recoup monorepo untangle-codebase workflow. Audit and decision log preceded implementation. Changes stay in this owning repository; no production deployment or main-branch merge requested. No broad comment/test-pruning sweep. Existing local work and retired checkouts preserved.
Each repository PR is independently reviewable; the Mono report will collect the coordinated audit, retained cases and check limitations.
Review follow-up
Error JSON is now typed as unknown and narrowed before field access. Malformed top-level null/primitive/array responses get the HTTP fallback. Tests preserve error/message ordering and coercion of zero, false and empty strings. This is the only intentional malformed-response behavior correction; typecheck and focused lint pass.