Skip to content

CAP-PFM-QRY-003Draft a query from a written request

Markdown

CAP-PFM-QRY-003

Draft a query from a written request

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

Planning

Feature
FEAT-PFM-QRY-01
Exercised by
FAS-PFM-QRY-01-01
Key concepts
CON-PFM-QRY-002
Actors
ACT-PFM-013
Depends on
CAP-PFM-QRY-001
Related
CAP-PFM-QRY-002
Proved by
ATS-PFM-QRY-003

Implementation

Executable suites
TST-PFM-QRY-227, TST-PFM-QRY-307

KindCapabilityProduct areaPlatformModuleQuestions, record exploration and data deliveryRevision1

Read atservices-platform ad3f6a65react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
A written question supplies a reviewed starting draft.Generated drafts preserve normal execution checks.Organizational AI usage is accounted for.
Surfaces
consoleapi

Controls

27 controls apply, from the corpus control catalogue.

TC-AI-001 TC-AI-002 TC-AI-003 TC-AI-004 TC-AI-005 TC-AI-006 TC-AI-007 TC-AVL-001 TC-AVL-004 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-DAT-004 TC-LOG-004 TC-LOG-005 TC-MON-001 TC-PI-001 TC-PI-002 TC-PI-004 TC-PI-005 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-VEN-001 TC-VEN-002 TC-VEN-003

Permissions

KeyChecked atScope
platform.queries.generateapitenant
<application>.<dataset>.query (the owner's key)servicetenant

Business Rules

12 rules, 11 to be proved before approval. A rule's product intent is derived from its origin: 0 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01must prove
Proposed
Query generation requires its own permission, independently of query-reading access, and a caller lacking that permission is refused.
permissionapitest
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses a caller without platform.queries.generate as 403, however much else they hold
02must prove
Proposed
Generation requires access to the requested dataset, rejecting unauthorized datasets and reporting unregistered datasets as missing.
permissionservicetest
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses a caller who may not query the dataset as 403
03must prove
Proposed
Generation accepts bounded, nonempty written text and returns the same validation code for empty, oversized or non-text requests.
validationapitest
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses an empty request as 400, naming the field
04must prove
Proposed
A generation request returns a record to poll, which only its initiating person can read within the originating workspace.
policyservicetest
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses the person who did not start it as 404, however much they hold
05must prove
Proposed
A generated query runs through ordinary execution as the requester and therefore cannot expand that person’s access.
invariantservicetest
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#runs the query it answered: the console can send it straight to the execute route
06must prove
Proposed
An exhausted organizational AI allowance refuses the request immediately with the required and remaining amounts.
policyservicetest
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses the request itself, rather than accepting it and failing two minutes later
07must prove
Proposed
Each request records one metered organizational invocation while withholding model and cost details from its requester.
calculationservicetest
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#recorded one metered invocation for the request, against this operation and its prompt version
08
Proposed
Generation may return clarification and interpretations without providing a query.
policyservicetest
09must prove
Proposed
Refinement creates a separate generation linked to its predecessor and rejects a predecessor still in progress.
validationservicetest
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#refuses a refinement of a generation that is still working as 400
10must prove
Proposed
An organization at its simultaneous-call limit receives a retry-later generation failure, with the refused invocation’s reason recorded.
policyservicetest
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#leaves a refused invocation that names the reason, the generation having been refused rather than failed
11must prove
Proposed
The recovery sweep fails work still unsettled after the worker timeout and margin, preserves an existing verdict, and deletes request and outcome records older than thirty days.
policyservicetest
services-platform:modules/queries/tests/integration/services/generate/start-and-reconcile-generations.integration.spec.js#fails the generation no worker is going to settle, with the code an operator reads
12must prove
Proposed
Generation rejects invalid or inaccessible query context before creating work; failure to invoke the worker settles the admitted generation as failed instead of leaving it working.
validationservicetest
services-platform:modules/queries/tests/integration/services/generate/start-and-reconcile-generations.integration.spec.js#refuses a query on screen naming a field nobody can query, listing the problem under the property it is about

Scenarios

IdGivenWhenThenProvenance
01A person can generate a query for an accessible dataset.They submit a written question.The returned draft includes the model’s attributed assumptions and explanation.test
services-platform:modules/queries/tests/e2e/generate-query.e2e.spec.js#answers the assumptions and the explanation the model gave, as what it said and not as the system’s own words

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.