feat(ts-sdk): batch outputs (JSON/HTML/CSV) + family-aware CLI with non-interactive mode - #153
Open
adnanrhussain wants to merge 4 commits into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
adnanrhussain
force-pushed
the
ahussain/batch-family-adapter
branch
from
August 8, 2026 04:45
a06dd8c to
bd1c3e5
Compare
adnanrhussain
force-pushed
the
ahussain/batch-standards-cli
branch
from
August 8, 2026 04:47
fbd59bc to
f9c184c
Compare
adnanrhussain
force-pushed
the
ahussain/batch-family-adapter
branch
from
August 8, 2026 04:57
bd1c3e5 to
2ef7183
Compare
adnanrhussain
force-pushed
the
ahussain/batch-standards-cli
branch
from
August 8, 2026 04:58
f9c184c to
802fb78
Compare
There was a problem hiding this comment.
Pull request overview
Adds family-aware batch output rendering (CSV/JSON/HTML) and extends the batch CLI to support evaluator families, member selection, model shortcodes, platform key resolution, and a non-interactive mode—making the math-standards-alignment family runnable end-to-end.
Changes:
- Introduces
renderOutputs()dispatching per-family output projections (standards: specialized CSV/JSON/HTML; others: existing formatters + new generic JSON). - Adds standards verdict browser HTML template + standards-specific output formatting utilities.
- Updates CLI + arg parsing to support
--family,--evaluator,--modelshortcodes/provider:model,--platform-api-key, and--yesnon-interactive flow.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| sdks/typescript/tests/unit/batch/output.test.ts | Adds unit tests for standards-family JSON/CSV/HTML projections and generic JSON for text-complexity. |
| sdks/typescript/tests/unit/batch/cli-args.test.ts | Adds tests for new CLI flags and resolveModel() behavior. |
| sdks/typescript/src/batch/README.md | Updates documentation for families, required columns/keys, and new CLI usage modes. |
| sdks/typescript/src/batch/output.ts | Adds renderOutputs() to select standards vs generic projections. |
| sdks/typescript/src/batch/index.ts | Exposes formatAsJSON, renderOutputs, and OutputBundle from the batch module. |
| sdks/typescript/src/batch/formatters.ts | Adds formatAsJSON() for generic machine-readable results (text-complexity). |
| sdks/typescript/src/batch/families/standards-report.html | Introduces self-contained HTML verdict browser template for standards results. |
| sdks/typescript/src/batch/families/standards-output.ts | Adds standards-specific CSV/JSON/HTML projection implementation and HTML injection. |
| sdks/typescript/src/batch/cli.ts | Refactors CLI to be family/member aware, support non-interactive mode, resolve required keys, and write 3 outputs. |
| sdks/typescript/src/batch/cli-args.ts | Adds parsing for new flags and implements MODEL_SHORTCODES + resolveModel(). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
adnanrhussain
force-pushed
the
ahussain/batch-family-adapter
branch
from
August 8, 2026 05:25
2ef7183 to
c9b767e
Compare
adnanrhussain
force-pushed
the
ahussain/batch-standards-cli
branch
3 times, most recently
from
August 8, 2026 06:00
3568049 to
a3c971a
Compare
adnanrhussain
marked this pull request as ready for review
August 8, 2026 06:02
…on-interactive mode
…row context, HTML escaping
adnanrhussain
force-pushed
the
ahussain/batch-standards-cli
branch
from
August 8, 2026 18:10
a3c971a to
61ed681
Compare
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.
Summary
Stacked on #152. Adds the output projections and the CLI flow for the family-adapter batch tool, making the
math-standards-alignmentfamily reachable end-to-end.What changed
Outputs (WS4)
renderOutputs(familyId, output, meta)dispatches per family →{ csv, json, html }.aligned_ratio, per-component detail as embedded JSON), and a self-contained HTML verdict browser (per-item aligned/total, expandable per-component reasoning/feedback, filter by standard/grade/status/text). Verdicts only — aggregate flag-rate/coverage is downstream interpretation.formatAsJSONfor the text-complexity family.CLI (WS5)
--family,--evaluator id[,id...], repeatable; interactive multiselect otherwise).--model <shortcode|provider:model>(shortcodes:haiku,opus) — also fixes the missing--modelalias.requiredKeys, including the always-required platform key for standards (--platform-api-key/PLATFORM_API_KEY).-y/--yes(and auto when no TTY) → non-interactive: never prompts, errors on missing input. Writesresults.csv+results.json+results.html.Validation
tsupbuild bundles the HTML template.standards-output.tsat 93% on covered code (11 survivors),output.tsat 100%. Line coverage was 100% before this pass and hid real gaps — CSV quote/comma/newline escaping and every HTML</>/&/U+2028 escape were executed but unasserted, so a mutant removing them survived.injectReportDatais extracted so the template-corruption guard is reachable without corrupting the real template. The remaining survivors are equivalent mutants (redundant!== nullguards already covered bytotalCount > 0) andtoLocaleStringdate-format options, where asserting an exact locale string would be brittle.ccss_standard→statementCode), resolved family/member, passed the row limit; on a 3-row slice with dummy keys it drove the full path to a real Knowledge Graph 401, proving request construction + per-row error isolation (3/3 errored, no whole-run abort) + all three outputs written with joinableoriginalRow. Successful-verdict path needs live keys.Review fixes
String.replacepattern. It was passed as the replacementstring, so
$$/$&/$`/$'in row data were substitution patterns:$$x^2$$in a questionrendered as
$x^2$, and$'spliced the template tail — including the closing</script>— into theinline script, defeating the escaping applied to the payload immediately above. Now a replacer function.
--evaluatorselection drives credential requirements.requiredKeysignored the selected members,so running only
grade-level-appropriateness(Google) still demanded an OpenAI key and blocked anotherwise valid non-interactive run. QTC now unions each selected member's
defaultProviders.toRowused a hand-rolled, case-sensitivealias list that disagreed with the family's
ColumnSpec(missingstatement_code/standard, inventingitem_id), so headers the CLI accepts on input were dropped from the reports.BatchResultnow carriesthe normalized
columns,item_idis a declared alias, and the source-row fallback matchescase-insensitively against the spec's own aliases.
Not included
🤖 Generated with Claude Code