Task: Declare an entity's HTTP area

Table of Contents

This page documents a task in the Let the area come from the model story. It captures the goal, current status, acceptance, and any notes or results.

1. Goal

An entity's HTTP area is a declaration on its model, resolved in one place, so a URL can outlive a component rename.

2. Status

Field Value
State DONE
Parent story Let the area come from the model
Now Nothing.
Waiting on Nothing.
Next Nothing.
Last touched 2026-10-31

3. Acceptance

  • [X] An entity that declares #+http_area: renders its routes under that area.
  • [X] An entity that declares no area renders under its component, so no existing URL moves.
  • [X] A declared area that is not in the published list fails a check.
  • [X] A codegen test covers both cases.

4. Plan

The declaration is a frontmatter scalar, read the way #+entity_plural: is read, and resolved in entity_http_route_plan where the path base is built. The default is the component, which is what every route answers on today, so this task changes no URL and a reader can see the mechanism without a migration in the same diff.

The published list is the one the inventory is classified against, so the tree keeps one list of areas instead of two.

5. Measurements

What Value Command Commit
Codegen route cases 22, all passing (3 new) projects/ores.codegen/venv/bin/python -m pytest projects/ores.codegen/tests/test_http_routes.py -q this branch
End to end a model declaring reference-data renders router->get("/api/v1/reference-data/currencies") ./projects/ores.codegen/codegen.sh generate --model projects/ores.refdata/modeling/ores.refdata.currency.org --address ores.cpp.http-route this branch
Declared areas today 0, so no URL moved python3 build/scripts/check_http_areas.py this branch

6. Notes

  • The end-to-end proof moved the currency routes and was reverted in the same pass, because moving a URL belongs to the task that also updates the client and the tests. What this task proves is that the mechanism resolves and renders, not that a route moved.
  • The gate refuses a declared area that is not published, and prints the published list, so a model author never has to find the list.

7. Result

A model states its area once and the routes render under it. No URL changed, and the next task can move one component at a time under a gate that already knows what an area is.

Emacs 29.3 (Org mode 9.6.15)