ek9_query_requirement

Answers status (ok | not-found) and requirementId first, then the node(s): each carries authored{title, body, retired, meta} and derived{developed, anchoringTests, parentChain, children} so a computed rollup is never mistaken for a person's assertion; list and outstanding return requirementCount + requirements[], footprint the anchoringTests and reachedSymbols.

Category: Enquiry · Compare: Requirement navigator tree + detail pane (planned)

When to use it

'What does requirement X say, and what is under it?' is one call: {mode:'detail', requirementId:'REQ:fraud-screening'}; mode 'outstanding' with no id is the backlog.

When not to use it

Details

Modes: detail (one node), hierarchy (subtree, optional depth), list (filter by developed/retired/prefix/assignee/titleLike), outstanding (live, not yet developed — the backlog), footprint (call-graph reach of the requirementId's anchoring tests - over-inclusive by construction, reachResolved:false when the call graph is unavailable). 'developed' is always derived and read-only - anchored by a @Test directly or via children, NOT that it is correct or adequately tested. Every response opens with status: 'ok', or 'not-found' from detail/hierarchy for an unknown requirementId; footprint just reports empty anchoringTests.

Arguments

ArgumentTypeRequiredWhat it is
assigneestringFor list: match nodes whose meta.assignee equals this.
depthintegerFor hierarchy: how far down to walk. Omit for the whole subtree; 1 gives the node and its direct children.
developedbooleanFor list: match only developed (true) or only outstanding (false). Omit to match either.
modestring: detail | hierarchy | list | outstanding | footprintyesWhich read to perform.
prefixstring: REQ | CTRL | CAP | CONFor list: match one node kind.
requirementIdstringRequired for detail, hierarchy and footprint, e.g. REQ:fraud-screening.
retiredbooleanFor list: match only retired (true) or only live (false). Omit to match either.
titleLikestringFor list: case-insensitive substring of the title or body.

Recorded calls

Real calls, recorded against small projects and checked on every build - a changed answer fails it. 3 of the 6 recorded are shown.

Query requirement not found

Request

{
  "mode" : "detail",
  "requirementId" : "REQ:never-created"
}

Response

{
  "detail" : "no requirement with this id exists in .ek9-ai/requirements/",
  "meta" : {
    "serverMs" : "<timing>"
  },
  "nextStep" : "ek9_query_requirement {mode:'list'} to see the ids that do exist",
  "requirementId" : "REQ:never-created",
  "status" : "not-found"
}

Query requirement footprint

Request

{
  "mode" : "footprint",
  "requirementId" : "REQ:fraud"
}

Response

{
  "anchoringTests" : [ "introduction::FraudTest" ],
  "meta" : {
    "serverMs" : "<timing>"
  },
  "note" : "reachedSymbols is what these tests CAN REACH, not what implements the requirement — over-inclusive by construction",
  "reachResolved" : true,
  "reachedSymbols" : [ "org.ek9.lang::Stdout.Stdout()" ],
  "requirementId" : "REQ:fraud",
  "status" : "ok"
}

Query requirement detail

Request

{
  "mode" : "detail",
  "requirementId" : "REQ:fraud"
}

Response

{
  "authored" : {
    "body" : "# Intent\n\nWhy this exists.",
    "meta" : { },
    "retired" : false,
    "ruleAnchors" : [ ],
    "title" : "Screen inbound payments",
    "version" : "0.1.0"
  },
  "derived" : {
    "anchoringTests" : [ "introduction::FraudTest" ],
    "children" : [ ],
    "depth" : 0,
    "developed" : true,
    "isLeaf" : true,
    "liveChildCount" : 0,
    "parentChain" : [ ],
    "ruleAnchored" : false,
    "viaChildren" : false
  },
  "meta" : {
    "serverMs" : "<timing>"
  },
  "requirementId" : "REQ:fraud",
...

Cut short here: 2 more lines. The whole recorded call.