Skip to content

Commit 2f6973a

Browse files
Merge pull request #44 from officialCodeWork/build/phase-6f/step-6f.2-field-patterns
test(eval): field-pattern regression fixture with xfail-tracked coverage gaps (6F.2)
2 parents 8737a1d + d45494a commit 2f6973a

19 files changed

Lines changed: 294 additions & 7 deletions

TRACKER.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
## Status
66

77
- **Current phase:** 6F — Field hardening, feedback round 1 (runs before 6.1–6.5)
8-
- **Next step:** 6F.2 field-pattern eval fixture
9-
- **Done:** 0.1–0.4, 1.1–1.6, 2.1–2.5, 3.1–3.6, 4.1–4.6, 5.1–5.7, 6F.1
8+
- **Next step:** 6F.3 instance→definition resolution hardening
9+
- **Done:** 0.1–0.4, 1.1–1.6, 2.1–2.5, 3.1–3.6, 4.1–4.6, 5.1–5.7, 6F.1–6F.2
1010
- **Gates passed:** Gate 0 (CI + red-path, #5/#6) · Gate 1 (precision 1.000, recall 0.895, zero poison) · Gate 2 (C1 instance attribution 1.000 · B1 4-level handler chains · C6 store writers↔readers · A9 portals — scorecard 137/0/0, precision & recall 1.000) · Gate 3 (B3 action effects · B4 routers · B6 cyclic journeys terminate · B7/B8 form & non-JSX events · G5 flag/role conditions — precision & recall 1.000) · Gate 4 (A4 rarity · A10 fuzzy/OCR · A1 structural · A6 subtree · E3 vision annotations · E2 aliases · G4 corrections — high-conf correct 1.000, ambiguity honesty 1.000, poison rate 0.000) · Gate 5 (F1 context bundle · F2 blast radius · F3 test coverage · F4 response schema · F5 git history · MCP server over stdio — scorecard 265/0/0, all honesty metrics 1.000; **M5 reached** — ticket in → budgeted context bundle out, over MCP)
1111

1212
## What CodeRadar is
@@ -375,7 +375,7 @@ CalendarPanel): gibberish declines, a real term ranks CalendarPanel top-1 with n
375375
noise, gibberish mixed into a real query doesn't poison it. 8 new core unit tests; eval
376376
271/0/0, gate OK.
377377

378-
### [ ] 6F.2 Field-pattern eval fixture
378+
### [x] 6F.2 Field-pattern eval fixture
379379
**Failure modes:** D2 (the eval blind spot itself)
380380
**Build:** new fixture `eval/fixtures/field-patterns` mirroring the shapes the field app used
381381
and current fixtures miss: multi-hop aliased barrel chains (`index.ts` re-export → tsconfig
@@ -387,6 +387,23 @@ data-source/route/coverage counts); checks owned by 6F.3–6F.6 land in an expli
387387
are enabled by their steps, so `pnpm eval` stays green throughout.
388388
**Accept:** fixture scans clean; 6F.1 checks green; skip list names the step that must enable
389389
each remaining check.
390+
**Done:** new fixture `eval/fixtures/field-patterns` (11 app files): two-hop barrel + rename
391+
(`components/index.ts``ui/index.ts` → definition), `@ui`/`@store/*` tsconfig-path aliases,
392+
`Loadable(lazy(() => import()))` page elements, route arrays declared in `routes.tsx`,
393+
spread-composed, and passed to `createBrowserRouter` as an imported identifier, an RTK Query
394+
store (`createApi` base + two `injectEndpoints` slices with string-form and object-form
395+
`query` plus a `builder.mutation`), and a test rendering through a custom
396+
`renderWithProviders` wrapper. The harness's native xfail is the skip list: 9 target checks
397+
carry `expectedFail` naming the enabling step (6F.3: DataGrid instance count + blast radius ·
398+
6F.4: two endpoint attributions · 6F.5: three routes, one effect, one journey), and
399+
unexpected-pass gating removes stale marks the moment a capability lands. checks.ts change:
400+
xfail-marked attributions stay out of the lineage precision/recall tallies while marked, so a
401+
known-missing capability doesn't depress global metrics. Scanning the fixture confirmed the
402+
field diagnosis — the `@ui` alias import yields NO instance node for UsersPage's `<Grid/>`,
403+
and 0 route/data-source/hook nodes exist. Already working in this shape (kept as passing
404+
checks): relative two-hop barrel rename (InvoicesPage's Grid), covered-by through the custom
405+
wrapper — so 6F.6 must find the actual field-breaking coverage variant and extend the fixture.
406+
eval 280 pass / 0 fail / 9 xfail / 0 unexpected-pass, gate OK, all metrics 1.000.
390407

391408
### [ ] 6F.3 Instance→definition resolution hardening
392409
**Failure modes:** A5, C1, F2, D4
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { renderWithProviders } from "../test-utils";
2+
import UsersPage from "../pages/UsersPage";
3+
4+
it("renders the team directory", () => {
5+
renderWithProviders(<UsersPage />);
6+
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Barrel-of-barrel with a rename — the multi-hop chain the field app used
2+
// everywhere (index.ts → ui/index.ts → definition).
3+
export { DataGrid as Grid } from "./ui";
4+
export { StatusBadge } from "./ui";
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { StatusBadge } from "./StatusBadge";
2+
3+
export function DataGrid({ rows }: { rows: string[] }) {
4+
return (
5+
<table>
6+
<thead>
7+
<tr>
8+
<th>Name</th>
9+
<th>Status</th>
10+
</tr>
11+
</thead>
12+
<tbody>
13+
{rows.map((row) => (
14+
<tr key={row}>
15+
<td>{row}</td>
16+
<td>
17+
<StatusBadge label="Active" />
18+
</td>
19+
</tr>
20+
))}
21+
</tbody>
22+
</table>
23+
);
24+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function StatusBadge({ label }: { label: string }) {
2+
return <span className="badge">{label}</span>;
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { DataGrid } from "./DataGrid";
2+
export * from "./StatusBadge";
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Suspense, type ComponentType, type LazyExoticComponent } from "react";
2+
3+
/** The field app's code-splitting helper: every page element goes through it. */
4+
export function Loadable(Component: LazyExoticComponent<ComponentType>) {
5+
return function LoadableWrapper() {
6+
return (
7+
<Suspense fallback={<div>Loading…</div>}>
8+
<Component />
9+
</Suspense>
10+
);
11+
};
12+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { createBrowserRouter } from "react-router-dom";
2+
3+
import { routes } from "./routes";
4+
5+
// The config is an imported identifier, not an inline array literal.
6+
export const router = createBrowserRouter(routes);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { useNavigate } from "react-router-dom";
2+
3+
export function HomePage() {
4+
const navigate = useNavigate();
5+
return (
6+
<main>
7+
<h1>Field Ops</h1>
8+
<button type="button" onClick={() => navigate("/users")}>
9+
View team
10+
</button>
11+
</main>
12+
);
13+
}
14+
15+
export default HomePage;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Grid } from "../components";
2+
3+
import { useListInvoicesQuery } from "../store/api/invoicesApi";
4+
5+
export function InvoicesPage() {
6+
const { data } = useListInvoicesQuery();
7+
return (
8+
<section>
9+
<h1>Invoice history</h1>
10+
<Grid rows={data ?? []} />
11+
</section>
12+
);
13+
}
14+
15+
export default InvoicesPage;

0 commit comments

Comments
 (0)