Skip to content

Commit 1931f01

Browse files
committed
session 2026-08-23 [Claude Code]
1 parent 7d5ca6c commit 1931f01

2 files changed

Lines changed: 98 additions & 1 deletion

File tree

‎memory/continuity.md‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
polyglot initiative: a lightweight Event-over-HTTP function host + thin client, repurposed
1818
August 2026 (legacy language pack in git history only)
1919
- **last_enabled:** 2026-08-22
20-
- **last_session:** 2026-08-23 | agent: Claude Code (2026-08-23-024221)
20+
- **last_session:** 2026-08-23 | agent: Claude Code (2026-08-23-031558)
2121
- **last_review:** (none yet)
2222
- **last_invariant_check:** (none yet)
2323
- **repo:** ~/sandbox/mercury-python (origin: github.com/Accenture/mercury-python)
@@ -114,6 +114,23 @@
114114
hosted→local-private. README boundary statement: leaf-side composition here; workflow
115115
processing = Event Script / Knowledge Graph.
116116
<!-- id: thread-primitive-event-bus | created: 2026-08-23 | last_used: 2026-08-23 | uses: 1 | tier: working | origin: 2026-08-23-005709 -->
117+
118+
- [ ] (feature — Eric's directive 2026-08-23, **IMPLEMENTED same day on
119+
`feature/primitive-event-bus`, commits `56c002c` + `a674198` (IDE/Sonar round);
120+
node twin `342a854` + `7a8b12c`; PENDING Eric's PR gate together with the bus**)
121+
**Actuator endpoints — the engines' operational surface for Kubernetes PODs.**
122+
GET `/info`, `/info/routes`, `/env`, `/health`, `/livenessprobe` on the Event API port;
123+
shapes mirror the Rust engine's actuator (the approved minimalist port of Java
124+
`ActuatorServices`). Health check functions are normal registered functions speaking
125+
the engines' `type=info` / `type=health` interface contract (Eric's ruling), listed in
126+
`mandatory.health.dependencies` / `optional.health.dependencies` and called through the
127+
event bus; `/health` = UP 200 / DOWN 400 (Java parity); `/livenessprobe` follows the
128+
most recent health outcome. Engine formats verbatim (origin = UTC yyyyMMdd + 32-hex
129+
uuid per the Java reference; elapsed-time boundary quirks pinned). Documented deltas:
130+
no `/info/lib`, no XML, no info cache. One async `handle()` dispatcher (S7503-clean,
131+
mirrors the node twin). 10 pins + live demo drives on both wrappers.
132+
Relates [[thread-primitive-event-bus]]; serves [[bp-publish-interop-gate]].
133+
<!-- id: thread-actuator-endpoints | created: 2026-08-23 | last_used: 2026-08-23 | uses: 1 | tier: working | origin: 2026-08-23-031558 -->
117134
> Mark completed items `- [x]` and leave them in place — the review sweeps them to
118135
> the archive once older than `archive_window` sessions. Don't archive them by hand.
119136
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Session (2026-08-23T03:15:58.000Z)
2+
3+
**Agent:** Claude Code
4+
5+
Actuator endpoints on `feature/primitive-event-bus` — Eric's directive right after the
6+
bus landed: the wrapper apps deploy as Kubernetes PODs, so they need the engines'
7+
operational surface. Commits `56c002c` (feature) + `a674198` (IDE/Sonar round).
8+
Node twin: `342a854` + `7a8b12c` (see mercury-nodejs memory, same-day log).
9+
10+
## What shipped
11+
12+
- `actuator.py`: GET `/info`, `/info/routes`, `/env`, `/health`, `/livenessprobe` on the
13+
Event API port. Response shapes mirror the Rust engine's actuator — itself the
14+
maintainer-approved minimalist port of Java `ActuatorServices` — so DevSecOps sees one
15+
surface across the estate: `/info` = `{app{name,version,description},
16+
runtime{language,python,mercury_composable}, origin, time{start,current}, up_time}`;
17+
`/info/routes` = `routing.public/private` (route → instances, sorted); `/env` = opt-in
18+
`show.env.variables` / `show.application.properties` (absent env var → `""`);
19+
`/health` = dependency entries `{route, required, …info map, status_code, message}`,
20+
UP 200 / DOWN 400 (Java parity), teaching message when no dependencies configured;
21+
`/livenessprobe` follows the most recent health outcome (`OK` / 400
22+
`Unhealthy. Please check '/health' endpoint.`).
23+
- **Health check functions = normal registered functions speaking the engines' interface
24+
contract (Eric's mid-session ruling, matching my derivation):** called through the
25+
event bus with header `type=info` (advisory identity map, merged into the entry) then
26+
`type=health` (non-200 = down); listed in `mandatory.health.dependencies` /
27+
`optional.health.dependencies` (optional never affects overall status); unregistered
28+
route → 404 `Please check - Route X not found`; DeliveryTimeout → 408
29+
`Please check - Timeout for 10000 ms`. Engine timeouts kept (info 3 s, health 10 s).
30+
- Engine formats verbatim: origin = UTC `yyyyMMdd` + 32-hex uuid (the JAVA reference
31+
format — the Rust port simplified to a bare uuid, so the wrappers follow the
32+
reference); `elapsed_time` with the engines' strict `>` boundary quirks (60 s →
33+
"60 seconds", 3600 s → "60 minutes") — pinned with the same vectors the Rust port pins.
34+
- Deliberate wrapper-scale deltas, documented in the module docstring: no `/info/lib`
35+
(no runtime dependency manifest — deferred on the Rust port too), no XML responses,
36+
no 5-second info cache (dependencies are in-process functions).
37+
- `version.py` becomes the single Python-side version source (`__init__` re-exports) —
38+
breaks the actuator → `__init__` import cycle.
39+
- The pre-release `/health` "OK" scaffolding endpoint is replaced by the real one.
40+
- IDE/Sonar round (Eric's screenshots): four S7503 async-without-await handlers → ONE
41+
async `handle()` dispatcher (awaits the `/health` branch; constant endpoints render
42+
synchronously) — the python Actuator now mirrors the node twin's dispatcher shape;
43+
`app_origin` adopts the local-narrowing pattern (checkers don't narrow module
44+
globals); "health check" spelling (Grazie); S5863 self-compare fixed in the origin
45+
test; the `handle_livenessprobe` name (typo dictionary) dissolved by the dispatcher.
46+
47+
## Verification
48+
49+
- 49/49 pytest (10 actuator pins: five shapes, liveness-follows-health round trip,
50+
optional-failure-never-downs, teach-message, elapsed/origin format vectors), ruff
51+
clean, basedpyright 0 — re-run after the Sonar round.
52+
- Live drive: `mercury-serve examples/demo_app.py --port 8399
53+
-Dmandatory.health.dependencies=demo.health` → all five endpoints engine-shaped;
54+
`/health` UP with the full `demo.health` dependency entry; node twin symmetric on 8398.
55+
- `examples/demo_app.py` gained `demo.health` (private, contract-speaking); README
56+
"Actuator endpoints" section (+ K8s wiring: livenessProbe → `/livenessprobe`,
57+
readinessProbe → `/health`); CHANGELOG entry.
58+
59+
## Follow-up round (Eric's three asks, commit `7d5ca6c`; node twin `8ed4266`)
60+
61+
- **`log.format` gains `compact`** — the engines' third presentation. Verified against
62+
the Java engine's own appenders (`JsonAppender` = Gson pretty serializer,
63+
`CompactAppender` = single-line serializer, same data map): so wrapper `json` is now
64+
PRETTY-PRINTED (indent 2) and `compact` is the single-line JSONL the old `json`
65+
emitted. Pinned: json has newlines, compact has none, both parse to the same entry.
66+
- **Sample `examples/resources/application.yml`** (both wrappers) — the engines'
67+
resources convention, auto-loaded by the CLI's next-to-app fallback: demo-app
68+
identity, port (8086 py / 8087 node), `mandatory.health.dependencies: demo.health`,
69+
opt-in /env lists, log keys. The demo now runs with plain
70+
`mercury-serve examples/demo_app.py` — no flags.
71+
- **README `-D` syntax** — quick starts teach `-Drest.server.port=8086` (engine syntax)
72+
instead of `--port`; the `--port`/`--config` CLI flags remain as conveniences.
73+
- Live drives re-run through the yml on both wrappers: /health UP under the demo-app
74+
identity, /env shows the opted-in keys, `-Dlog.format=compact` emits JSONL. Gates:
75+
50/50 pytest + ruff + basedpyright 0; node 48/48.
76+
77+
## Memory References
78+
79+
- created: thread-actuator-endpoints
80+
- referenced: thread-primitive-event-bus, bp-publish-interop-gate, vision-mercury-python

0 commit comments

Comments
 (0)