Skip to content

docs(recon): as-built identity model, modality evidence, proof obligations and v1 consumer contract - #337

Merged
hyperpolymath merged 7 commits into
mainfrom
docs/as-built-identity-recon-2026-10-29
Oct 31, 2026
Merged

hyperpolymath merged 7 commits into
mainfrom
docs/as-built-identity-recon-2026-10-29

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Independent code-grounded reconnaissance as of main 5876bc67e8962e3b276fb0161664e0b3a420a64c.

Adds three review documents:

  • docs/reviews/2026-10-29-verisimdb-as-built-recon.adoc — source-derived architecture, conceptual ER, eight-modality/persistence matrix, actual lifecycle, P0/P1/P2 discrepancy register, tests and formal proof obligations, independent Mathesis/QuandleDB/JanusKey/Marches reuse, prioritized engineering programme.
  • docs/consumer-interface-contract-v1-observed.adoc — actual flatten-vs-nested HTTP ABI, operations, HTTP statuses, feature/configuration guarantees and explicit non-guarantees.
  • docs/reviews/2026-10-29-hypatia-verified-handover.adoc — only verified downstream integration facts.

No rewrite of the Octad schema; accepted generic term modality profile distinguished from modality set and consonance subject. References separate code fixes #333, #334, #335, #336. Makes no soundness claims beyond observed source/test status. No data mutation.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Caution

Review failed

The pull request is closed.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@hyperpolymath
hyperpolymath marked this pull request as ready for review October 29, 2026 20:31
@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 29, 2026 20:31
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T22:43:48.017824Z 8ab971d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7e3d18d5c1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


== Endpoint and versioning

* HTTP Axum API listens on \`ApiConfig.host:port\` (defaults \`[::1]:8080\`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Report the executable's wildcard bind default

When the server binary starts without VERISIM_HOST, main.rs constructs ApiConfig with [::], bypassing the [::1] value from ApiConfig::default; with authentication also disabled by default, this distinction determines whether the API is remotely reachable over IPv6. Describing the operational default as loopback can therefore lead deployments to expose an unauthenticated listener unintentionally.

Useful? React with 👍 / 👎.

|Route |Current semantics |Important guarantee boundary
|\`POST /octads\` |Create subject, server-generated ID, 201 |Flattened payload accepted by runtime, *not* the nested published OctadInput schema; default storage is in-memory
|\`GET /octads/{id}\` |Read current subject, 200 or 404 |Results may be incomplete if a modality store is inconsistent
|\`PUT /octads/{id}\` |Merge supplied fields into existing subject, 200 or 404 |Not a replace; omissions retain earlier modalities

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document the asymmetric title/body update semantics

For an existing document, this is not a field-level merge: OctadRequest::to_octad_input turns a title-only request into a replacement document with an empty body, while a body-only request creates no document input and leaves the old document untouched. A consumer following this contract can therefore erase content when attempting to update only the title; describe this asymmetry or require both fields rather than promising that supplied fields are merged.

Useful? React with 👍 / 👎.

Comment on lines +76 to +79
\`graph\`, \`document\`, \`vector\` nested root keys from
\`connectors/shared/json-schema/octad-input.json\` are **not** runtime
HTTP request fields. On the base revision, serde ignores them, silently
losing their values. Proposed PR #334 rejects such payloads instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Include semantic among silently ignored schema fields

A schema-conforming payload such as {"semantic":{"types":[...]}} is also silently discarded on the reviewed revision: OctadRequest has no semantic field and expects top-level types instead. Because this warning enumerates only graph, document, and vector, clients may reasonably infer that the schema's nested semantic object is supported and receive a successful response with their annotations missing.

Useful? React with 👍 / 👎.

|===
|Route |Current semantics |Important guarantee boundary
|\`POST /octads\` |Create subject, server-generated ID, 201 |Flattened payload accepted by runtime, *not* the nested published OctadInput schema; default storage is in-memory
|\`GET /octads/{id}\` |Read current subject, 200 or 404 |Results may be incomplete if a modality store is inconsistent

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge State that GET omits all modality payloads

The runtime OctadResponse contains only the ID, timestamps/version, has_* flags, and version/provenance counts; it drops the loaded document, embedding, tensor, semantic annotation, graph data, spatial data, and metadata. Consequently GET /octads/{id} cannot actually return the current subject content, even when every store is consistent, so consumers need this response-shape incompatibility called out rather than only a warning about inconsistent stores.

Useful? React with 👍 / 👎.

|\`GET /search/related/{id}\` |Graph traversal |Graph edges may outlive deleted registry rows
|\`GET /drift/entity/{id}\` |Per-entity score and computability flags |Score not an identity or authority proof
|\`POST /normalizer/trigger/{id}\` |Regeneration of selected modality |Side effects and ranked authority; not a guaranteed safe proof-preserving repair
|\`GET /provenance/{id}\`, \`/verify\` |Hash-chain retrieval and verification |No external signed root or certified actor identity

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Do not advertise the stubbed provenance verify route

For any existing entity, provenance_verify_handler returns "chain_valid": true without calling verify_chain, including when the entity has no provenance or its persisted chain is corrupt. Only the retrieval handler performs verification, so presenting /verify as hash-chain verification can cause consumers to accept fabricated integrity success.

Useful? React with 👍 / 👎.

Comment on lines +158 to +160
. \`PUT /octads/{id}\`: currently *merge/update*, not replace. Omitted
modalities remain populated; the temporal snapshot stores the supplied
update input, not a complete materialized entity.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Qualify modality retention across WAL replay

With the persistent feature, a clean partial update followed by restart does not retain the earlier modality status: replay_wal keeps only the last operation payload per entity and rebuilds ModalityStatus solely from that partial OctadInput. The older modality data remains in its physical stores but becomes inaccessible through the registry, so the claim that omitted modalities remain populated is only true before replay and misses a production data-visibility failure distinct from the interrupted-intent bug described below.

Useful? React with 👍 / 👎.

@@ -0,0 +1,134 @@
// SPDX-License-Identifier: CC-BY-SA-4.0
= VeriSimDB Consumer Interface Contract — Observed v1 Boundary

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Register the new documents in the documentation index

docs/INDEX.adoc explicitly describes itself as the table of contents for everything under docs/, but none of the three documents added here is listed there. The only reference from the handover to the consumer contract is an inline literal rather than an AsciiDoc link, so readers following the repository's official documentation navigation cannot discover this contract or either review document.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb8890d4a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

|429 |Auth rate limiter (when enabled)
|500 |Store/serialization/runtime error; generic client message for \`ApiError::Internal\`
|501 |Explicit \`ApiError::NotImplemented\`
|503 or startup failure |Do not assume readiness; persistent WAL replay failure is non-fatal on \`main\`, proposed PR #333 makes it fatal before listener start

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reflect the landed fail-closed WAL recovery

This no longer describes the reviewed revision: commit c5e6ac8 is this commit's parent, and its AppState::new_async returns an error when replay_wal fails, preventing the listener from starting; its replay implementation also pairs each intent with its own commit marker. Presenting that behavior as merely proposed can mislead operators about whether ambiguous persistent state will be served, and the other references to PR #333 as unmerged should be updated at the same time.

Useful? React with 👍 / 👎.

Comment on lines +89 to +94
|401 |Authentication middleware enabled, credentials absent/invalid
|403 |RBAC authorization denial, or federation registration without configured PSK
|404 |Unknown subject or endpoint
|413 |Oversized request body, under body-limit middleware
|422 |Axum JSON deserialization rejection (including unknown input keys after proposed PR #334)
|429 |Auth rate limiter (when enabled)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge State that the server cannot enable authentication

For deployments of the stock server binary, these authentication-dependent statuses are not merely conditional on configuration: serve() obtains its state from AppState::new_async, which always installs AuthState::default() with enabled = false, while neither ApiConfig nor main.rs exposes auth settings or API-key registration. Consequently operators cannot enable the middleware through the advertised executable at all, so describing 401/RBAC/limiting as available “when enabled” obscures that every request remains unauthenticated unless a separate embedding application constructs and mutates AppState itself.

Useful? React with 👍 / 👎.

|\`GET /provenance/{id}\`, \`/verify\` |Hash-chain retrieval and verification |No external signed root or certified actor identity
|\`POST /provenance/{id}/record\` |Append provenance event |Caller-provided actor text must not be treated as attestation
|\`POST /vcl/execute\` |Subset SELECT, SEARCH, INSERT, DELETE, SHOW, COUNT, EXPLAIN |TypeLL/VCL-UT request is best-effort and never blocks an action if unavailable
|\`POST /federation/query\` |HTTP query fan-out to registered peers |Not atomic identity federation or independent witness verification

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Clarify that TypeLL results never block VCL mutations

This qualifier understates the observed behavior when TypeLL is reachable: vcl_execute_handler executes INSERT or DELETE before merely attaching the returned safety metadata, and it also proceeds when the checker returns a non-success status. Thus no TypeLL verdict—including a level indicating an unsafe transition—can block the action, not just checker unavailability; consumers relying on a live validator as an admission gate can still perform rejected mutations.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdf8d68ab9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +155 to +157
\`OctadInput\`. The coordinator generates an ID and logs intent, locks
requested modalities, writes stores sequentially, appends a temporal
version, updates the registry, then emits a commit marker.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify intent logging as persistent-only

With the default non-persistent build described immediately above, InMemoryOctadStore::new leaves wal as None, so the pre-write wal_append and commit-marker calls are no-ops; only AppState::new_async under the persistent feature invokes with_wal. Stating unconditionally that every POST logs an intent and emits a commit marker can make operators of the default build assume recovery evidence exists when it does not, so this lifecycle step should be explicitly scoped to persistent deployments.

Useful? React with 👍 / 👎.

Comment on lines +20 to +21
* GraphQL: \`POST /graphql\` and \`GET /graphiql\`; gRPC Tonic service on
separate configurable port, default 50051. Authentication of gRPC is

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify gRPC availability when TLS is enabled

In deployments of the stock binary with both VERISIM_TLS_CERT and VERISIM_TLS_KEY set, main.rs calls serve_tls, and that function starts only the Axum TLS listener; the configurable Tonic server is started exclusively by the non-TLS serve path. Thus clients following this contract will find no service on port 50051 in an otherwise supported TLS configuration, so the endpoint description should document this exception rather than presenting gRPC as uniformly available.

Useful? React with 👍 / 👎.

|Route |Current semantics |Important guarantee boundary
|\`POST /octads\` |Create subject, server-generated ID, 201 |Flattened payload accepted by runtime, *not* the nested published OctadInput schema; default storage is in-memory
|\`GET /octads/{id}\` |Read current subject, 200 or 404 |Results may be incomplete if a modality store is inconsistent
|\`PUT /octads/{id}\` |Merge supplied fields into existing subject, 200 or 404 |Not a replace; omissions retain earlier modalities

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Document false modality flags in PUT responses

When an update omits an already-populated modality, storage retains it in modality_status, but InMemoryOctadStore::update returns an Octad containing only modalities written by that request, and OctadResponse::from derives every has_* flag from those optional payload fields. A document-only update to an entity that already has a vector therefore returns has_vector: false even though a subsequent GET reports it as present; consumers using the PUT response as the current merged state need this inconsistency called out.

Useful? React with 👍 / 👎.


* PR #333: committed-intent WAL replay, fail closed on ambiguity.
* PR #334: refuse silently dropped Octad JSON fields.
* PR #335: unrelated strict-Clippy baseline fixes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark PR #335 as already merged

The reviewed commit's immediate parent is 8af7bde, whose subject is the landed fix(ci): remove pre-existing unused RAM promotion fields (#335). Listing #335 under changes still under review and then stating that none of them is merged gives readers an incorrect CI-baseline status and may prompt duplicate remediation work; record it as landed rather than proposed.

Useful? React with 👍 / 👎.

|\`GET /drift/entity/{id}\` |Per-entity score and computability flags |Score not an identity or authority proof
|\`POST /normalizer/trigger/{id}\` |Regeneration of selected modality |Side effects and ranked authority; not a guaranteed safe proof-preserving repair
|\`GET /provenance/{id}\`, \`/verify\` |Hash-chain retrieval and verification |No external signed root or certified actor identity
|\`POST /provenance/{id}/record\` |Append provenance event |Caller-provided actor text must not be treated as attestation

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document the record route's 500 for unknown subjects

For POST /provenance/{id}/record with a well-formed but nonexistent ID, OctadStore::update returns OctadError::NotFound, but this handler maps every store error to ApiError::Internal; the observed response is therefore a generic 500 rather than the 404 that the contract associates with an unknown subject. Clients may otherwise treat this permanent missing-entity condition as a retryable server failure, so the route-specific behavior should be stated until the handler maps NotFound correctly.

Useful? React with 👍 / 👎.

@hyperpolymath
hyperpolymath enabled auto-merge (squash) October 30, 2026 15:32
@hyperpolymath
hyperpolymath merged commit 95c9e96 into main Oct 31, 2026
57 of 62 checks passed
@hyperpolymath
hyperpolymath deleted the docs/as-built-identity-recon-2026-10-29 branch October 31, 2026 22:40
@sonarqubecloud

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ab971dc4a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +78 to +79
HTTP request fields. On the base revision, serde ignores them, silently
losing their values. Proposed PR #334 rejects such payloads instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Describe nested payload rejection as current behavior

PR #334 is already the immediate parent of this revision, where OctadRequest has #[serde(deny_unknown_fields)] and nested schema payloads return 422. Presenting rejection as merely proposed leaves consumers unable to determine the actual wire behavior and incorrectly suggests that current requests may succeed while losing values; document rejection as the observed behavior and mark #334 as landed.

Useful? React with 👍 / 👎.

Comment on lines +254 to +256
The repository's \`docs/proof-debt.adoc\` reports 13 declared Coq
\`Axiom\` instances, zero \`Admitted\` and an assumption-whitelist build gate.
That is a useful audit inventory, not proof that the Rust implementation

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recount the current Coq axioms

The formal corpus at this revision declares 11 Axiom commands, not 13: six in Drift.v, two in Normalizer.v, and one each in PlannerSemantic.v, Provenance.v, and WAL.v. The referenced proof-debt ledger still counts two discharged optimize_is_permutation assumptions even though Planner.v now proves that result and PlannerSemantic.v imports it, so presenting the ledger as a useful current inventory gives proof reviewers the wrong trusted-base count; report 11 or explicitly identify the ledger as stale.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants