Task: Verify country shell commands post-NATS
Table of Contents
This page documents a task in the Commission: country story. It captures the goal, current status, acceptance, and any notes or results.
Goal
Verify the five countries shell submenu commands against live services post-NATS: help, get (list), add, delete, history. Fix or file regressions; refresh stale captured results in the shell recipes.
Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Commission: country |
| Now | All five commands verified working on v0.0.21; recipes refreshed. |
| Waiting on | Nothing. |
| Next | Codegen back-out task (3E63E209) is now unblocked. |
| Last touched | 2026-06-25 |
Acceptance
- All five shell commands run successfully against live services with correct output.
- Add is paired with delete (clean DB).
- Recipe captured results refreshed to match current output.
- Regressions fixed or filed.
Plan
Notes
Known regression: countries get parse error
During initial verification, countries get returns ✗ Failed to parse
response on v0.0.21 while the refdata service shows the request was
handled successfully (the service logs the NATS subject). The shell
log shows the request was initiated at the same timestamp as the
logout, suggesting the response arrived and was attempted to be parsed
but the format does not match what the shell expects.
The recipe captured results for get_3.org are from v0.0.8 and show a
different output format. The response format may have changed in the
NATS-migration refactor. Needs investigation.
Shell submenu commands are accessed as:
login <user>@<tenant> <password> countries get countries add <alpha2> <alpha3> <numeric> <name> <official_name> <reason_code> "commentary" countries delete <alpha2> countries history <alpha2>
No --tenant needed (session is already scoped to the logged-in tenant).
PRs
| PR | Title |
|---|---|
| #1312 | [commission_country] Verify shell commands and back out country via codegen |
Review
| # | Comment summary | File | Decision | Notes |
|---|---|---|---|---|
| 1 | \`do_request\` unused after fix | countries_commands.cpp | Fixed in 6dfa6589c — removed | |
| 1 | \`fail(out) << "" <<\` redundant empty string | countries_commands.cpp | Fixed in 6dfa6589c | |
| 1 | Index rename leaves old index on existing DBs | refdata_countries_create.sql | Not changed — generated file; \`compass db recreate\` drops everything; incremental migration is out of scope | |
| 1 | Grammar: "a alpha2_code" in validate fn comment | refdata_countries_create.sql | Not changed — template-generated; template fix deferred | |
| 1 | \`task_country_codegen_backout.org\` PR table empty | task_country_codegen_backout.org | Fixed in 6dfa6589c | |
| 1 | Shell scripts not retangled (drift CI failure) | scripts/library/countries/*.ores | Fixed in 6dfa6589c |
Result
| Command | Status | Notes |
|---|---|---|
| countries help | PASS | Sub-menu help lists all commands correctly. |
| countries get | PASS | Fixed: changed do_request → do_auth_request + is_logged_in() guard. Returns 249 countries (14/page, page 1 of 3). |
| countries add | PASS | Added XX XXX 999 "Test Country"; confirmed success. |
| countries delete | PASS | Deleted XX; confirmed success. DB left clean. |
| countries history | PASS | GB shows version 1 record with correct columns. |
Fix committed to projects/ores.shell/src/app/commands/countries_commands.cpp:
process_get_countries now uses do_auth_request so the JWT is sent, enabling
the service's make_request_context to establish tenant RLS. Without auth, the
service returned an empty error_reply payload which the shell could not parse.