Deterministic integration layer: format-facts, pricing-diff, classify-request#1
Merged
Deterministic integration layer: format-facts, pricing-diff, classify-request#1
Conversation
…sify-request Three new helper scripts with full test coverage, wired into four skills and the research-brief retrieval workflow: - scripts/format-facts.mjs — converts a facts.json sidecar into a compact block (~300-500 tokens) for prompt injection or a markdown report for human review; groups by domain, reconstructs pricing tuples from shared excerpts - scripts/pricing-diff.mjs — builds a multi-source markdown pricing comparison table from two or more facts.json packs; includes Review Signals table and Coverage Notes; supports --dir discovery mode - scripts/classify-request.mjs — pure pattern-matcher that classifies a query into pricing/competitive/market-size/acquisition/funding/reviews/general and returns suggestedMode, priorityFacts, and collectorHints; no network calls Skills updated: - adversarial-review: Pre-Check step runs validate-artifact.mjs before manual review - artifact-quality-audit: Step 1b pre-pass floors Correctness dimension scoring - pricing-strategy Step 5: pricing-diff.mjs replaces manual table construction - competitive-landscape Step 3: pricing-diff.mjs populates pricing fields - shipwright-research-brief: classify-request at Step 1, format-facts at Step 3, pricing-diff for multi-competitor requests Tests: 121 passing (25 classify-request, 21 format-facts, 29 pricing-diff, plus 46 pre-existing across collect-research, source-adapters, validate-artifact) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… layer - classify-request: suggestedMode now returns collector-compatible values (auto/standard/deep) instead of internal labels (pricing/research/news), so output can be passed directly to collect-research.mjs --mode - format-facts + pricing-diff: remove silent USD default when currency field is absent; bare price is emitted instead of fabricating a $ symbol - pricing-diff --dir: fix directory argument mis-parse that caused the dir path itself to be treated as a facts file - collect-research: accept previous mode alias values as backward-compatible fallbacks so existing callers aren't broken by the mode rename - Skills: prefer repo-level scripts/collect-research.mjs over .codex/.claude copies because only the repo-level collector writes facts.json; .codex and .claude copies noted as fallbacks that may only emit evidence.md - Tests: 4 new tests (CLI --dir coverage, no-USD-default for both helpers, suggestedMode collector-compatibility invariant); 125 passing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
scripts/classify-request.mjs— pattern-matches a query to one of 7 request types and returns collector-compatiblesuggestedMode(auto/standard/deep),priorityFacts, andcollectorHints; no network callsscripts/format-facts.mjs— converts afacts.jsonsidecar into a compact block (~300-500 tokens) for prompt injection or structured markdown for human review; groups by domain, reconstructs pricing tuples from shared excerptsscripts/pricing-diff.mjs— deterministic markdown pricing comparison table from 2+facts.jsonpacks; includes Review Signals table, Coverage Notes, and--dirdiscovery modesource-adapters.mjs,validate-artifact.mjs, v2 facts extractor fieldsFixes (second commit)
classify-requestmodes are now collector-compatible (auto/standard/deep)currencyis absent in format-facts or pricing-diffpricing-diff --dirno longer mis-parses its own directory argumentcollect-researchaccepts old mode alias values as backward-compatible fallbacksscripts/collect-research.mjs(the one that writesfacts.json)Test plan
--dirmode, no-USD-default invariant,suggestedModecollector-compatibility🤖 Generated with Claude Code