Skip to content

feat: expose source context and project-safe summary hints - #392

Closed
seonghobae wants to merge 827 commits into
ContextualWisdomLab:mainfrom
seonghobae:feat/board-source-detail-state-filter
Closed

seonghobae wants to merge 827 commits into
ContextualWisdomLab:mainfrom
seonghobae:feat/board-source-detail-state-filter

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • expose authorized Customer Master source-customer hint lookup by exact observed code
  • surface source-field combination evidence in the board without replacing the human-readable context
  • keep event titles out of inferred project candidates unless the body identifies a project
  • distinguish explicit organization responsibility (lw_responsible_for) from support (lw_supports)
  • preserve the remote source visibility, queue, and synthetic-data boundaries through a normal merge

Verification

  • uv run pytest -q tests/test_post_summary.py: 44 passed, 1 skipped
  • targeted backend API contract: 2 passed after merge repair
  • pnpm test -- App.test.tsx: 104 passed
  • pnpm run lint
  • git diff --check

Exact current head: a046da4e. Temporary exploratory scripts and untracked agent directories were intentionally not included.


Open in Devin Review

…s' into fix/pr311-current

# Conflicts:
#	frontend/src/PostBody.tsx
… into codex/normalize-source-indent-semantics
@seonghobae

Copy link
Copy Markdown
Contributor Author

Re: persist_turn dropping citations outside source_post_ids (global_ask_history.py:264-271) — this is the correct fail-closed boundary, not an accidental drop: source_post_ids is the bounded evidence set the orchestrator was actually given, so a citation outside it would mean the orchestrator claimed a source it was never shown -- exactly the kind of ungrounded citation AGENTS.md's evidentiary boundary exists to prevent from being persisted as real history. Resolving.

devin-ai-integration[bot]

This comment was marked as resolved.

read_post_summary already fetched the post-content ingestion job but
discarded its status_code, always raising the same "still being
processed" 503 detail regardless of whether the job was genuinely
queued/running or had terminally FAILED -- telling the reader to keep
waiting for evidence that will never arrive.

post_content_summary_status_message(status_code) already existed in
post_content_queue.py for exactly this distinction (added for
read_post_content's identical pattern); read_post_summary just never
called it. Pass job.status_code through instead of the hardcoded
string.
@seonghobae

Copy link
Copy Markdown
Contributor Author

Fixed: read_post_summary already fetched the post-content ingestion job but discarded its status_code, always raising the same "still being processed" 503 regardless of terminal failure. post_content_summary_status_message(status_code) already existed in post_content_queue.py for exactly this distinction (read_post_content already used it); read_post_summary just never called it. Added a regression test for the failed-job case plus a still-processing case to confirm no behavior change there. Pushed in 71fd6cc.

devin-ai-integration[bot]

This comment was marked as resolved.

@seonghobae
seonghobae enabled auto-merge (squash) August 22, 2026 12:02
@seonghobae

Copy link
Copy Markdown
Contributor Author

Acknowledged — cosmetic title-formatting inconsistency between list and detail views (raw truncation vs whitespace-collapsed + fallback), not introduced by this PR's changes. Worth a small follow-up to share one title-formatting helper between the two, but out of this PR's scope. Tracking, not blocking.

Two unrelated findings from review, both real:

1. migrations/0001_initial_schema.sql had been edited to add
   cataloged_affiliated_corporate_entity_id plus a constraint extension --
   but migrations/0107_role_affiliation_catalog_identity.sql already adds
   the same column and an equivalent constraint idempotently. Verified via
   docker/postgres-init/Dockerfile (0001 is baked into the image for fresh
   installs only) and migrate.sh's replay allowlist (0107 replays on every
   startup, 0001 does not): the edit gave fresh installs two overlapping
   constraints while existing volumes got only 0107's, a real schema drift
   between fresh and upgraded databases. Reverted 0001 to its pre-edit
   state per ADR 0120's migration-immutability principle; 0107 alone now
   produces the identical schema on both paths. Two test fixtures that
   hand-list migration files for a throwaway test database (masked by
   0001's improper edit until now) needed 0107 added to their setup.

2. synthetic_seed_cleanup.py's "real evidence" predicate included
   source_draft_code/source_deleted_flag, disagreeing with
   demo_scope.has_real_source_context's deliberate omission of both. Per
   ADR 0040/0058, a draft/deleted marker is a publication lifecycle
   signal, not identity/content evidence that a post is a real imported
   record. Rewired cleanup to reuse the shared
   source_context_missing_sql/source_context_present_sql predicate from
   backend/app/post_eligibility.py (already the source of truth
   demo_scope.py uses) instead of hand-maintaining a duplicate 20-field
   list that had drifted. Updated the one test whose assertion depended
   on the old (incorrect) behavior, and added a regression test proving
   the two predicates now agree.
@seonghobae

Copy link
Copy Markdown
Contributor Author

Fixed and independently verified — confirmed via docker/postgres-init/Dockerfile (0001 is baked into the image, fresh-install only) and migrate.sh's replay allowlist (0107 replays on every startup, 0001 does not) that this was real schema drift: fresh installs would end up with two overlapping constraints, existing volumes with only one. Reverted 0001 to its pre-edit state per ADR 0120's immutability principle; 0107 alone produces the identical schema on both paths. Two test fixtures that hand-list migration files needed 0107 added (masked by 0001's improper edit until now). Pushed in efe00f8.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Fixed — confirmed via ADR 0040/0058 that a draft/deleted marker is a publication lifecycle signal, not identity/content evidence, and backend/app/post_eligibility.py's SOURCE_CONTEXT_COLUMNS (already demo_scope.py's source of truth) also excludes both fields. Rewired synthetic_seed_cleanup.py to reuse the shared source_context_missing_sql/source_context_present_sql predicate instead of hand-maintaining a duplicate list that had drifted. Updated the one test whose assertion depended on the old behavior and added a regression test proving both predicates now agree. Pushed in efe00f8.

devin-ai-integration[bot]

This comment was marked as resolved.

@opencode-agent
opencode-agent Bot disabled auto-merge August 22, 2026 15:28
seonghobae and others added 2 commits August 22, 2026 23:39
…ntextualWisdomLab#459)

Adds a closed reason vocabulary (tied candidates / no live enrichment
client / checked-but-not-corroborated / no catalog entry) persisted on
post_summary_role and surfaced in the R&R panel, replacing the single
flat "Not linked to catalog" label the product-technical-gap-baseline
audit flagged as undiagnosable. Covers both the primary actor's own
catalog link and the separate affiliated-organization link, since the
shipped label actually renders next to the latter.

Also:
- ADR 0142 proposes (decision only, no inference code) reusing the
  existing post_summary_semantic_relationship channel with a new
  lw_plans_to_operate predicate for planned-facility evidence, per the
  gap doc's explicit instruction not to write that inference without a
  reviewed ADR first.
- frontend/index.html now shows a visible, styled <noscript> message
  instead of a silent blank page.
- Updates docs/product-technical-gap-baseline.md for both items.

Backend: pytest -q tests/ backend/tests/ -- 875 passed, 17 skipped.
Frontend: pnpm run lint && pnpm run test && pnpm run build -- 220
passed, lint clean, build succeeds; pnpm run build-storybook succeeds.


Claude-Session: https://claude.ai/code/session_011EP69xAyLaJxa6oaF6D9eq

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
…ilter' into repair/pr392-promote

# Conflicts:
#	tests/test_person_mention_projection.py
@seonghobae
seonghobae enabled auto-merge (squash) August 23, 2026 06:48
devin-ai-integration[bot]

This comment was marked as resolved.

:responsibleFor was declared with rdfs:range :SemanticAssertion, so a
reasoner applying standard entailment would type a responsible-for
project (e.g. Highland HVDC) as an evidence/assertion node. Align it
with its sibling :supports: prov:Agent domain, prov:Entity range.
Document lw_responsible_for alongside lw_supports in ADR 0131, and add
a test asserting both predicates' domain/range.

Also add the zh, ja, and vi translations for the six i18n keys this
PR introduced (Responsible for, and the source customer code search
strings), which had only been added to the ko block, leaving those
locales showing raw English for a brand-new feature.
@github-actions
github-actions Bot disabled auto-merge August 23, 2026 06:58
@seonghobae
seonghobae enabled auto-merge (squash) August 23, 2026 07:00
@opencode-agent
opencode-agent Bot disabled auto-merge August 23, 2026 07:38
@seonghobae
seonghobae enabled auto-merge (squash) August 23, 2026 07:40
@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent Review exact current head b76ae7b9. The only code change removes the confirmed dead KG neighbor list; the separate raw/resolved affiliation-name thread is ADR 0127 behavior and is resolved without code change. Focused Global Ask source tests pass 9/9. Publish only a same-head independent verdict.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Exact review head is b76ae7b9ba56e2756c0a5dcf0c4623698ae14961; do not transfer evidence from a73d9885.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Correction: the authoritative current head returned by GitHub is b76ae7b9aa7bf16f70d712dffb2514dc9467dde1. Review only this exact head.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Superseded by #490 (same feat/board-source-detail-state-filter work on the origin branch). Closing this fork PR so the unique stack stays one.

@seonghobae seonghobae closed this Aug 23, 2026
auto-merge was automatically disabled August 23, 2026 14:08

Pull request was closed

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants