forked from boos/BoosAPI
[codex] add harness engineering guardrails (#284)
* refactor: add harness engineering guardrails * fix: address harness review feedback --------- Co-authored-by: apple <apple@appledeMacBook-Pro.local>
This commit is contained in:
@@ -61,14 +61,10 @@ describe('final transformer hard-cut architecture', () => {
|
||||
|
||||
for (const file of files) {
|
||||
const source = readFileSync(file, 'utf8');
|
||||
expect(source).not.toContain("from '../../routes/proxy/");
|
||||
expect(source).not.toContain("from '../routes/proxy/");
|
||||
expect(source).not.toContain("from '../../services/oauth/");
|
||||
expect(source).not.toContain("from '../services/oauth/");
|
||||
expect(source).not.toContain("from '../../services/tokenRouter.js'");
|
||||
expect(source).not.toContain("from '../services/tokenRouter.js'");
|
||||
expect(source).not.toContain("from '../../routes/proxy/runtimeExecutor.js'");
|
||||
expect(source).not.toContain("from '../routes/proxy/runtimeExecutor.js'");
|
||||
expect(source).not.toMatch(/(?:^|\n)\s*(?:import|export)\s+(?:type\s+)?(?:[^'"\n]*?\s+from\s+)?['"][^'"]*routes\/proxy\//m);
|
||||
expect(source).not.toMatch(/(?:^|\n)\s*(?:import|export)\s+(?:type\s+)?(?:[^'"\n]*?\s+from\s+)?['"][^'"]*services\/oauth\//m);
|
||||
expect(source).not.toMatch(/(?:^|\n)\s*(?:import|export)\s+(?:type\s+)?(?:[^'"\n]*?\s+from\s+)?['"][^'"]*services\/tokenRouter\.js['"]/m);
|
||||
expect(source).not.toMatch(/(?:^|\n)\s*(?:import|export)\s+(?:type\s+)?(?:[^'"\n]*?\s+from\s+)?['"][^'"]*routes\/proxy\/runtimeExecutor\.js['"]/m);
|
||||
expect(source).not.toContain("from 'fastify'");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import type { Response as UndiciResponse } from 'undici';
|
||||
import {
|
||||
buildMinimalJsonHeadersForCompatibility,
|
||||
isEndpointDowngradeError,
|
||||
isUnsupportedMediaTypeError,
|
||||
type CompatibilityEndpoint,
|
||||
} from '../../shared/endpointCompatibility.js';
|
||||
import type { EndpointAttemptContext, EndpointRecoverResult } from '../../../routes/proxy/endpointFlow.js';
|
||||
import {
|
||||
buildResponsesCompatibilityBodies,
|
||||
buildResponsesCompatibilityHeaderCandidates,
|
||||
@@ -19,6 +19,20 @@ type CompatibilityRequest = {
|
||||
body: Record<string, unknown>;
|
||||
};
|
||||
|
||||
type EndpointAttemptContext = {
|
||||
request: CompatibilityRequest;
|
||||
targetUrl: string;
|
||||
response: UndiciResponse;
|
||||
rawErrText: string;
|
||||
};
|
||||
|
||||
type EndpointRecoverResult = {
|
||||
upstream: UndiciResponse;
|
||||
upstreamPath: string;
|
||||
request?: CompatibilityRequest;
|
||||
targetUrl?: string;
|
||||
} | null;
|
||||
|
||||
type UpstreamResponse = Exclude<EndpointRecoverResult, null>['upstream'];
|
||||
|
||||
type CreateResponsesEndpointStrategyInput = {
|
||||
|
||||
Reference in New Issue
Block a user