fix(cli): bound Blazegraph Docker logs - #2086
Conversation
| function formatBlazegraphImageMetadata(metadata) { | ||
| const parsed = parseBlazegraphImageMetadata(metadata); | ||
| return `${parsed.image}\t${parsed.containerPort}`; | ||
| return `${parsed.image}\t${parsed.containerPort}\t${parsed.dataPath}`; |
There was a problem hiding this comment.
🟡 Issue: Avoid growing the metadata contract as positional TSV
What's wrong
The underlying contract is JSON, but the shared helper flattens it into an order-dependent tab string. Adding dataPath exposes the fragility: unrelated consumers must change simply because the tuple gained a field. This makes the contract harder to evolve and hides which component actually depends on which metadata.
Example
The devnet path needs image and containerPort, while CI needs image, containerPort, and dataPath. With the current tuple ABI, adding a future field like logDriver forces every shell consumer to know the new position even if it does not use the field.
Suggested direction
Keep the metadata boundary structured. Either emit JSON for shell consumers to parse, or add an explicit field-selection mode so callers request image, containerPort, or dataPath directly instead of unpacking a positional tuple.
For Agents
Update packages/cli/blazegraph-image-metadata.cjs and the shell consumers. Preserve validation and current metadata values. Prefer JSON output or explicit field selection, then update scripts/devnet.sh, scripts/ci/verify-blazegraph-image-contract.sh, and metadata tests to prove each consumer reads only the fields it owns.
| exit 1 | ||
| fi | ||
|
|
||
| curl -fsS --max-time 10 -X POST \ |
There was a problem hiding this comment.
🟡 Issue: Do not add another copy of the namespace XML contract
What's wrong
This diff adds a third place that knows the exact Blazegraph namespace XML. The PR is already centralizing image/container metadata, so duplicating the namespace contract in the new persistence check goes the opposite direction and increases drift risk.
Example
If the namespace policy changes, for example textIndex, axiomsClass, or quads, the CLI template can be updated while this CI persistence contract continues creating namespaces with the old XML. The persistence check would still pass while no longer matching the production namespace shape.
Suggested direction
Move namespace XML generation into a shared scriptable helper, or expose it from the existing CommonJS metadata helper, then have CI and any shell path call that instead of carrying their own copy.
For Agents
In scripts/ci/verify-blazegraph-image-contract.sh, preserve the persistence restart check but source the namespace XML from one canonical helper. A small CommonJS helper callable from shell is likely the cleanest place because the existing metadata parser is already used by both CI and devnet.
Summary
Why
The mainnet fleet accumulated unbounded json-file logs as large as 72 GB per Blazegraph container. Explicit per-container rotation keeps behavior independent of Docker daemon defaults, while the named volume makes journal data durable across container recreation.
Validation
Operational note
This changes newly provisioned containers. Existing mainnet containers were migrated separately with byte-size/ownership verification and health checks.