Skip to content

feat(ontology): traverse evidence-backed projects - #663

Merged
seonghobae merged 234 commits into
mainfrom
feat/ontology-project-nodes-v2200
Aug 26, 2026
Merged

feat(ontology): traverse evidence-backed projects#663
seonghobae merged 234 commits into
mainfrom
feat/ontology-project-nodes-v2200

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Outcome

Closes the PRD-FR-2 gap between persisted post_project_mention evidence and the bounded ontology neighborhood.

  • registers canonical node_project / edge_mention_project vocabulary mappings
  • projects authorized, cutoff-safe Post → Project facts as truth_proposed
  • accepts only persisted canonical project keys and never invents a UUID, score, or authority
  • keeps labels derived only from visible evidence, falling back to the canonical key on a visible-name conflict
  • renders Project as a text-labeled diamond in graph, exact-value, CSV, JSON-LD, print, and Storybook surfaces
  • records ADR 0222 and refreshes PRD/gap/Storybook traceability

Verification

  • uv run --extra dev --extra backend pytest tests/test_ontology_neighborhood.py tests/test_ontology_neighborhood_ingestion.py tests/test_ontology.py tests/test_ontology_shapes.py tests/test_migration_replay.py tests/test_public_docstrings.py tests/test_schema.py -q — 102 passed
  • frontend Vitest — 41 files / 383 tests passed
  • frontend lint, production build, and Storybook build passed
  • synthetic Storybook desktop 1280×720 and mobile 390×844 screenshots inspected; Project diamond, proposed truth label, and exact-value row are readable

Boundaries

PostgreSQL remains authoritative. This PR does not create a project catalog, promote extracted mentions, expose hidden counts, or add mathematical weights.


Open in Devin Review

seonghobae and others added 30 commits August 25, 2026 22:09
* fix(ask): release pool before embedding provider work

* style: keep load evidence reviewable

* docs(gaps): refresh protected delivery evidence

* fix(ask): reject blank embedding requests

* fix(ask): preserve unavailable embedding short circuit

* fix(ask): honor validated precomputed embeddings

* fix(ask): honor precomputed embedding envelope

* fix(k6): reject unitless request timeouts

* fix(migrations): replay global ask queue safely

* fix(ask): reject nonfinite embeddings

* perf: keep authenticated web reads responsive (#633)

* fix(backend): make the similar-VOC SQL audit reason adjacent (hotfix main)

The similar-VOC candidate fetch already carried a suppression, but its
Safe SQL reason sat three lines above the audited call while the review
contract requires the immediately preceding line. Collapse the comment
to one adjacent line; the counted total stays 36 because this repairs
an existing site rather than adding one.

* perf: keep authenticated web reads responsive

* docs: record authenticated capacity comparison

---------

Co-authored-by: seonghobae <seonghobae@users.noreply.github.com>

* feat(semantic): nominate Ask evidence candidates

---------

Co-authored-by: seonghobae <seonghobae@users.noreply.github.com>
* feat(ask): verify public semantic claims

* docs(gaps): record public verification stack

---------

Co-authored-by: seonghobae <seonghobae@users.noreply.github.com>
…ance' into repair-pr632-verification-contract
Co-authored-by: seonghobae <seonghobae@users.noreply.github.com>
* feat(ask): ground answers at knowledge cutoff

* docs(gaps): record cutoff candidate exact head

---------

Co-authored-by: seonghobae <seonghobae@users.noreply.github.com>
* feat(ask): ground answers at knowledge cutoff

* docs(gaps): record cutoff candidate exact head

* fix(ci): keep static lineage SQL outside calls

---------

Co-authored-by: seonghobae <seonghobae@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Merged current protected-main base and resolved the baseline conflict. New exact head: d3bb934872a593d1c71c36c8403781544db0ea8b. Focused ontology/neighborhood/shape tests: 81 passed. Hosted checks and independent review remain required.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Confirmed the label-less ontology behavior is deliberate fail-closed handling: ontology_annotations refuses to emit an ontology IRI without a readable governed label, and the existing ontology regression test asserts this. A future term must add its label in the ontology source and pass the registry/publication checks before it can affect Global Ask; silently degrading a declared term would create an unlabeled customer-facing fact.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Confirmed the next_action on successful live Ask answers is intentional product contract: every customer-facing explanation supplies a next action, and VERIFICATION_SKIPPED explicitly tells the operator how to enable public verification. Cutoff answers replace it with their evidence-specific action; existing delivery tests cover both paths.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Implemented at exact head 7ac1483: both PostgreSQL integration fixtures now apply migrations with autocommit enabled, matching production psql -X semantics for CREATE INDEX CONCURRENTLY; the API fixture returns to transactional mode before seed inserts. The MCP Compose profile now depends on the backend worker, so the documented MCP-only startup has a durable Global Ask consumer. Fixture compilation passed; hosted required Checks remain pending.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Root cause fixed at exact head 74b9a1d9: the hosted Full suite failed because tests/test_schema.py sent migration 0210 as one multi-statement psycopg2 execute, so PostgreSQL rejected CREATE INDEX CONCURRENTLY inside that implicit transaction. The fixture now executes each migration statement separately, matching production psql -f semantics. Focused schema migration/index tests pass 2/2; the hosted Full suite should be rerun on the new head.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Fixed the exact-head Full-suite failures at f616887a: the semantic-only retrieval test now reuses the authenticated fixture DSN, and the schema fixture returns to transactional mode after concurrent-index replay so savepoints/rollback assertions remain valid. Targeted tests pass (2 passed). Hosted checks will re-run on the new head.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Confirmed this informational note at exact head f616887a: the evidence-channel fallback is intentional and fail-closed. It only activates when no embedding was supplied; explicit invalid precomputed vectors still return no sources, preserving the ADR boundary.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 2 new potential issues.

Open in Devin Review

Comment thread backend/app/main.py
Comment thread backend/app/mcp_server.py
@seonghobae
seonghobae merged commit faff7a3 into main Aug 26, 2026
33 checks passed
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