Run artifact

workspace/targets/jq/ANALYSIS.md

Blueprint Analysis: jq

Commander Expectations

Crew

CrewCharge
CommanderDefines intent and decides what done means.
Team LeadConfirms epic completeness and stakeholder expectations.
Planning CrewAuthors atomic specifications and the ordered Manifest.
Shipyard CrewBuilds the tickets without synchronous Commander access.

Story List

Feature: Language Front End

IDStoryHigh-level AC
FRONTEND-001Parse jq expressions into an abstract syntax treeThe parser accepts the supplied valid syntax and rejects the supplied invalid syntax with compile exit code 3.
FRONTEND-002Tokenize literals, strings, interpolation, and commentsThe lexer handles jq literals, escapes, interpolated strings, format strings, and comments as exercised by the corpus.

Feature: Generator Evaluation Core

IDStoryHigh-level AC
CORE-001Evaluate identity, literals, pipelines, and generatorsFilters preserve jq input/output semantics, stream order, and cartesian-product behavior.
CORE-002Construct and iterate arrays and objectsArray and object construction, indexing, iteration, and slicing produce the expected values.
CORE-003Evaluate arithmetic, comparison, and logical operatorsOperators follow jq type rules, value ordering, and generator behavior.
CORE-004Evaluate conditionals, alternatives, and error handlingif, boolean operators, //, try, catch, and optional expressions produce the expected streams and errors.
CORE-005Evaluate reductions, loops, and control transferreduce, foreach, limit, skip, first, last, nth, labels, and break preserve generator behavior.
CORE-006Evaluate variables, destructuring, and user-defined functionsBindings, patterns, function arguments, scoping, recursion, and destructuring alternatives behave as specified.

Feature: Paths and Assignment

IDStoryHigh-level AC
PATHS-001Evaluate paths and path-based lookuppath, paths, getpath, and pick identify and retrieve the expected locations.
PATHS-002Set, update, and delete values by pathAssignment operators and path mutation functions update or remove the expected values.

Feature: Built-in Functions

IDStoryHigh-level AC
BUILTINS-001Provide type, length, and conversion functionsType inspection, length, string conversion, numeric and boolean parsing, and Unicode conversions follow jq behavior.
BUILTINS-002Provide array and object utilitiesSorting, grouping, uniqueness, entries, containment, combinations, transpose, flattening, and related utilities produce expected results.
BUILTINS-003Provide string and regular expression functionsString manipulation, matching, capture, splitting, substitution, and scanning produce expected results.
BUILTINS-004Provide formatting and encoding functionsjq format filters for JSON, HTML, URI, CSV, TSV, shell, and Base64 produce expected outputs.
BUILTINS-005Provide math and numeric edge-case functionsMath functions and special numeric values follow the corpus expectations, including the non-decnum behavior.
BUILTINS-006Provide date and time functionsDate parsing, conversion, formatting, and broken-down time functions produce expected results.
BUILTINS-007Provide streaming, recursion, and traversal utilitiesrecurse, walk, tostream, fromstream, and related generators produce expected streams.
BUILTINS-008Provide environment, diagnostics, and input functionsEnvironment access, input, inputs, debug, stderr, and location values follow the interface and corpus expectations.
BUILTINS-009Provide SQL-style operators and builtin inventoryINDEX, JOIN, IN, and builtins produce the expected results.

Feature: Command-Line Interpreter

IDStoryHigh-level AC
CLI-001Run jq filters through the executable interfaceThe root-level executable accepts -c and a filter, reads JSON from stdin, and emits compact JSON values one per line with jq-compatible exit codes.
CLI-002Document interpreter usage and verificationThe README documents stdin/stdout behavior, exit codes, and the supplied full-suite command.

Feature: Conformance Verification

IDStoryHigh-level AC
VERIFY-001Run the scoped conformance cases for implemented constructsEach implementation story's scoped runner invocation executes its matching cases and exits zero.
VERIFY-002Gate completion on the complete conformance corpusThe terminal verification runs sh sources/full_test.sh and asserts its return code is zero.

Story Guidance

Named stories planning must produce. Authoritative record: STORY_GUIDANCE.json.

None.

Surfaced Acceptance Criteria

None.

Source Inventory

PathContent kindDispositionReason
sources/INSTRUCTIONS.mdmarkdownanalyzedreadable UTF-8
sources/builtin.jqtextanalyzedreadable UTF-8
sources/exclusions.txttextanalyzedreadable UTF-8
sources/full_test.shcodeanalyzedreadable UTF-8
sources/jq-manual.txttextchunkedsplit into 11 bounded chunks
sources/jq.testtextchunkedsplit into 5 bounded chunks
sources/lexer.ltextanalyzedreadable UTF-8
sources/parser.ytextanalyzedreadable UTF-8
sources/run_conformance.pycodeanalyzedreadable UTF-8

Relationship Model

Source or groupRelationship typeRelated source or groupEvidenceDelivery implication
sources/lexer.ldependencysources/parser.yLexer tokens and string-interpolation states feed the grammar.Implement tokenization before or alongside parser work.
sources/parser.ydependencysources/jq-manual.txtGrammar settles syntax and precedence; the manual defines behavior.Parser work precedes evaluator behavior.
sources/jq-manual.txtnormative specificationInterpreter implementationManual sections define filter and builtin semantics.Build stories should cite the relevant manual sections.
sources/builtin.jqreference-to-replacementBuiltin implementationThe file defines jq-level builtin implementations and compositions.Use it as semantic guidance while implementing builtins.
sources/jq.testtest-kit-to-implementationInterpreter implementationCorpus exercises syntax, generators, paths, assignments, builtins, and edge cases.Each implementation story runs a nonempty scoped slice.
sources/run_conformance.pyinstruction-to-testsources/jq.testRunner parses cases and supports --select; it compares values and exit codes.Stage unchanged and use scoped runs except at the terminal gate.
sources/full_test.shinstruction-to-testsources/run_conformance.pyScript checks executable presence and invokes the runner unfiltered.Only the terminal verification story invokes this script.
sources/exclusions.txttest-kit-to-implementationsources/run_conformance.pyRunner applies declared exclusions and errors on stale entries.Stage unchanged with the corpus and runner.
sources/INSTRUCTIONS.mdauthor intentAll implementation and verification storiesIt defines the interface, restrictions, implementation order, and done conditions.Use as prompt context; the imported instruction file is not staged.

Source Roles

PathRolePlan dispositionBuild disposition
sources/INSTRUCTIONS.mdauthor intentprompt-onlyprompt-only
sources/builtin.jqreference implementationcontextstage
sources/exclusions.txtconformance harnesscontextstage
sources/full_test.shconformance harnesscontextstage
sources/jq-manual.txtnormative specificationcontextstage
sources/jq.testnormative specification and conformance test suitecontextstage
sources/lexer.lnormative specificationcontextstage
sources/parser.ynormative specificationcontextstage
sources/run_conformance.pyconformance harnesscontextstage

Planning Instructions

Delivery Shape

A local command-line interpreter reads JSON from standard input, evaluates a jq filter supplied on the command line, and writes each compact JSON result to standard output. The build flow is to implement the lexer and parser, add the generator-based evaluator and language features, implement builtins, provide the executable and README, run scoped corpus slices during implementation, then run the supplied full harness once as the terminal verification.

Story Realization Map

Story IDDurable Blueprint scopeEvidenceRelated filesRequires
FRONTEND-001jq grammar and ASTsources/parser.ysources/lexer.l, sources/jq-manual.txtcapability
FRONTEND-002jq lexical rulessources/lexer.lsources/parser.y, sources/jq.testcapability
CORE-001Generator execution model and core filterssources/jq-manual.txt, sources/jq.testsources/parser.ycapability
CORE-002Constructors, indexing, iteration, and slicessources/jq-manual.txt, sources/jq.testsources/parser.ycapability
CORE-003Arithmetic, comparisons, and boolean operatorssources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
CORE-004Conditional and error controlsources/jq-manual.txt, sources/jq.testsources/parser.ycapability
CORE-005Reducers, generators, labels, and breakssources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
CORE-006Bindings, patterns, functions, and scopesources/jq-manual.txt, sources/parser.y, sources/jq.testsources/builtin.jqcapability
PATHS-001Path generation and lookup functionssources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
PATHS-002Assignment and deletionsources/jq-manual.txt, sources/jq.testsources/parser.y, sources/builtin.jqcapability
BUILTINS-001Type, length, conversion, and Unicode functionssources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
BUILTINS-002Array and object utilitiessources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
BUILTINS-003Strings and regular expressionssources/jq-manual.txt, sources/jq.testsources/lexer.l, sources/builtin.jqcapability
BUILTINS-004Output formatting and encoding filterssources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
BUILTINS-005Math and numeric behaviorsources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
BUILTINS-006Date and time functionssources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
BUILTINS-007Streaming and recursive traversal utilitiessources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
BUILTINS-008Environment, I/O, diagnostics, and locationssources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
BUILTINS-009SQL-style operators and builtin listsources/jq-manual.txt, sources/jq.testsources/builtin.jqcapability
CLI-001Executable command interfacesources/INSTRUCTIONS.mdsources/full_test.sh, sources/run_conformance.pycapability
CLI-002Project READMEsources/INSTRUCTIONS.mdsources/full_test.shdocumentation
VERIFY-001Scoped conformance verificationsources/INSTRUCTIONS.mdsources/run_conformance.py, sources/jq.test, sources/exclusions.txttest harness
VERIFY-002Complete-suite terminal verificationsources/INSTRUCTIONS.md, SEA_TRIALS.mdsources/full_test.sh, sources/run_conformance.py, sources/jq.test, sources/exclusions.txtacceptance contract

Test and Acceptance Strategy

Implementation stories run sources/run_conformance.py with JQ set and a nonempty --select expression scoped to the construct implemented by that story. Use --list during planning to inspect and size selectors, not as a behavior acceptance check. The sole terminal verification invokes sh sources/full_test.sh, asserts only that the return code is zero, and prints captured output for diagnosis. It is the only unfiltered full-suite run and carries the Sea Trial.

Sequencing and Dependencies

Implement the lexer and parser before evaluator features. Establish generator evaluation before paths, assignment, control flow, functions, and builtins. The executable and README complete the user-facing interface. Scoped verification accompanies implementation; terminal verification depends on every implementation story. Stage the corpus, harness, exclusions, manual, grammar, lexer, and builtin reference so build and acceptance steps can read them.

Source Conflicts and Gaps

No unresolved conflicts or human-owned questions were found. The imported sources specify the product, implementation language, runtime restrictions, interface, corpus, exclusions, and verification command. Deployment is not applicable to the described local CLI.

Analysis Notes

generated: 2026-10-28 blueprint: /mnt/c/Users/barlo/projects/drydock/uat/jq/runs/20261028.145919/workspace/targets/jq/blueprint

Quality: Ready blockers: 0 questions: 0 features: 6 stories: 23 stack: Python display_name: not proposed short_description: not proposed

None.