Repository navigation
feat: add synthetic context-scoring shadow experiment - #43
Conversation
|
@snowopsdev is attempting to deploy a commit to the 0xBuns Team on Vercel. A member of the Team first needs to authorize it. |
Add an offline example that compares batch and per-chunk Noul layouts. Preserve original context and qualify uncertainty and cost estimates. Document the flow with Mermaid and a visual using the repository palette. Verdict impact: None. Refs TypeSafeAI#3 Co-Authored-By: Codex <noreply@openai.com>
4179407 to
22a523b
Compare
PR #43 — feat: add synthetic context-scoring shadow experimentIntentThis PR adds a fully offline, scripted demonstration of how a context-relevance scorer would decide which context chunks to keep or drop before sending them to a proposer. No live AI calls are made. The caller's original context is never modified. Results are explicitly labeled "synthetic demonstration." The work closes issue #42, advances roadmap phase 4, and follows the pattern established by PR #30. The two request layouts compared are:
Observed evidenceWhat is solid
Concrete bugs and risks1. Label mismatch in layoutMarkdown("All chunks, one Noul per chunk", "fan_out", ...)The fan_out layout sends ONE request with all questions inside it. The label "one Noul per chunk" implies separate requests. The per_chunk label is "One request per chunk." A reader comparing the two labels will likely mis-parse which layout is which. Consider "All chunks, one request" vs. "One request per chunk." 2. fan_out layout body includes chunk texts twice — possibly unintentional 3. 4. 5. Missing context (not observable from this diff)
Recommended next steps
|
|
PR #43 review — feat: add synthetic context-scoring shadow experiment (TypeSafeAI/jev-harness) IntentAdds a fully offline, example-local kit under examples/context-scoring-shadow/ that demonstrates how a context-relevance scorer would propose keep/drop sets before a proposer call. It compares two Noul request layouts — fan_out (one request, one question per chunk) and per_chunk (one request per chunk) — driven by a scripted fake adapter. No live provider call, no root export, no production ContextScorer, and the caller context is never mutated. Closes #42, refs #3, advances roadmap phase 4, follows PR #30. Blast radius is low: net-new files plus one package.json script and docs. Observed evidence (verified against the diff)
Concrete bugs and risks
Methodology caveat (not a bug): results report recall against synthetic labels but not precision — a scorer that keeps everything scores recall 1.0. Fine for a demo, but any go/no-go decision must not read recall alone (the roadmap already says 'not token counts alone'). Missing context (cannot be verified from this diff)
Recommended next steps
Note: an existing PR comment by BunsDev covers much of this ground; this review independently confirms those points and additionally elevates the fan_out size-comparison skew (item 1) and the recall-only methodology caveat. This is an inert analysis — no files were changed and nothing was posted, committed, or merged. |
Remove repeated chunk text from combined requests and record the changed context as question set v2. Keep sample output under CLI regression tests, clarify layout labels, and preserve cancellation behavior. Verdict impact: None. Refs TypeSafeAI#42 Co-Authored-By: Codex <noreply@openai.com>
|
Addressed the feedback from both reviews in
Local type checking, the full test suite, build, secret scan, and whitespace checks pass on this commit. Independent review found no remaining actionable issues. No live provider or Codex comparison ran. GitHub marks the new commit signature Verified. The workflow for this commit needs maintainer approval before its checks and full-history secret scan can run. The Vercel preview also still needs deployment-team authorization. Verdict impact: None. |
Reuse the pinned JEV_MODEL and dataRecord/dataArray from src/contract. Snapshot the task once, read chunks by index, and copy cost evidence with JSON semantics, so hostile or malformed inputs give unknown cost instead of rejecting the run. Stop dispatch after a same-tick abort, collapse the duplicated cancellation paths, and make cost unknown when the two layouts report different baselines. Expose the CLI as main(argv, io) behind scripts/, returning 2 on usage errors and accepting "--". Label net savings with their sign and mark classifications from an incomplete turn as non-recommendations. Add tests for recall below 1, cost bindings, usage completeness, adapter errors, nested snapshots, answer validation, the provenance gate, cancellation propagation and frozen calls. Separate the observed baseline from the modeled counterfactual in the docs, note that fan_out does not pack chunks into shared state, and render overview.html from overview.svg. sample-result.json is byte-identical; questions, criteria, note, thresholds, versions and wire bodies are unchanged. Verdict impact: None. Refs TypeSafeAI#42 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
BunsDev
left a comment
There was a problem hiding this comment.
Thanks @snowopsdev for the thoughtful contribution and for working through the review iterations. The latest version keeps this experiment offline and example-local, excludes labels from scorer inputs, retains all context on incomplete evidence, and clearly separates synthetic cost arithmetic from live measurements. The earlier payload duplication and artifact-drift concerns are addressed. Verified the updated branch with pnpm verify: boundary checks, typecheck, all 345 tests, production build, and secret checks pass. Hosted checks and secret scan also pass on this exact head. No proposal-review verdicts change; the live egress and integration gates remain open.
What changed
This adds an offline experiment that shows which pieces of made-up context would be kept or dropped. The answers are scripted, and the original context stays untouched. It doesn’t measure real accuracy or savings.
jev-1.13.0constant and tracks the experiment’s questions under their own version.Run
pnpm experiment:context-shadowfor JSON, or add--format markdownfor a readable report. Usage errors exit with status 2.Closes #42
Refs #3
Follows PR #30.
Second review round (
a1a654b)src/contractinstead of copying them, so a future pin change can’t miss this example.overview.htmlnow embedsoverview.svginstead of copying it.sample-result.json, the questions, criteria, untrusted-data note, thresholds, versions and request bodies are unchanged by this round.Experiment flow
flowchart TD A["Synthetic task and context chunks"] --> B["Build both Noul request layouts"] A --> H["Original context stays intact with caller"] B --> C["Scripted fake adapter — no provider call"] C --> D{"Complete usable evidence?"} D -->|Yes| E["Proposed keep/drop sets; uncertainty retained"] D -->|No| F["Unavailable: retain all; propose no drops"] E --> G["JSON or Markdown report"] F --> G L["Evaluation labels and cost observations"] -.->|Report only| GSynthetic example
The probabilities shown are scripted values recorded in the sample result. See the experiment guide for the request, evidence, and cache-accounting boundaries.
Verdict impact
Verdict impact: None. This doesn’t change how proposed actions are reviewed or who decides whether they can run. The proposal-review questions, decision table and AI model stay the same.
This only adds an offline experiment using made-up examples. It doesn’t change the app, contact an AI service, or remove anything from an agent’s context. Testing with live data and deciding whether to use this in a working agent are still future steps.
Verification
pnpm typecheck: passes locally ona1a654b.pnpm test: 339 of 339 pass locally ona1a654b. The test calls the CLI in process and compares its exact JSON withsample-result.json, so an outdated sample failspnpm test.22a523b,1873005anda1a654bVerified. The merge frommain(5c24184) was committed and signed by GitHub.context-relevance-v2in1873005because the combined request’s state changed; the wording didn’t change. The example guide records why.Also checked locally:
pnpm build, the secret scan and whitespace checks pass. The SVG parses, and the visual was inspected in a browser; no automated test checks the diagrams. Tests used fake responses only, and no live AI calls or Codex comparison ran.Pending: the checks workflow for
a1a654bneeds maintainer approval, so CI (including the full-history secret scan) hasn’t run on any commit after22a523b. The Vercel preview needs approval from the deployment team.