fix: bootstrap repo-root sys.path in operator scripts missing it - #541
fix: bootstrap repo-root sys.path in operator scripts missing it#541seonghobae wants to merge 894 commits into
Conversation
Forward-only conflict resolution uses protected main as the tree baseline and reapplies the exact twelve-file Event Lineage delta. This preserves current main product/security changes plus direction, dates, evidence, accessibility, Figma/Storybook, i18n, cycle safety, changelog, and stabilization-plan contracts without rewriting history or dropping capability.
…ame-evidence-lineage' into repair/pr258-current
…hub.com/ContextualWisdomLab/LineageWeave into codex/review-pr258-current
# Conflicts: # frontend/src/App.tsx # lineageweave/post_summary.py # tests/test_post_summary.py
* fix: require explicit location evidence in 5W1H * refactor: stop loading unused 5W1H counterparties * refactor: remove stale 5W1H location lookup
…e last page total_count came from count(*) over(), a window function that only rides along on rows surviving the query's own OFFSET/LIMIT. Once the offset skipped past every matching row, the query returned zero rows and total_count silently fell back to 0 even though matches existed -- a routine "user paged past the end" or "a filter change shrank the result set" scenario. A paginator relying on total_count to detect the overshoot would instead see "0 results" and could wrongly conclude nothing matched. Extracted the query's ~170-line predicate into a shared _list_posts_predicate_sql variable (byte-identical to the inline text it replaces) so a small fallback count(*) query -- used only when the main page comes back empty -- can reuse it without duplicating that much SQL. Renumbers the shared predicate's $10/$11 to $7/$8 since the fallback has no offset/limit/sort parameters of its own. Regression test confirmed RED (reported 0 instead of the real count) before GREEN. Also updated the repo's static SQL-suppression count contract (37 -> 38) for the new reviewed nosemgrep site. Found by an Explore agent hunting for a different bug class after the "unfiltered-then-filtered ABAC leak" well ran dry this session. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011EP69xAyLaJxa6oaF6D9eq
A key-set diff of i18n.ts's four non-English locale blocks found 117 keys added for Korean that were never mirrored into zh/ja/vi -- t() silently falls back to the raw English key when a translation is missing, and no test catches it since the existing i18n test only checks curated key lists a component's keys have to be manually added to (AdminPanel's never were). Closed the 20 keys AdminPanel.tsx actually uses (control center, endpoint catalog, tenant settings, board/calendar/entity navigation, and related copy) with zh/ja/vi translations matching this file's established terminology (Tenant, Workspace, Board, Admin), and added a curated adminPanelLabels parity test following the exact pattern the existing workspace/Event Lineage label tests already use. Confirmed RED (falls back to the English key) before GREEN. The remaining 97 ko-only keys (used by components not yet audited) are intentionally not touched here -- translating 97 keys x 3 locales without a dedicated review pass risks shipping worse translations than the visible-gap status quo, and is tracked as a separate follow-up in the gap baseline rather than forced through this checkpoint. Found by an Explore agent hunting for a non-ABAC-leak bug class. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011EP69xAyLaJxa6oaF6D9eq
* fix: gate image summaries on persisted vision evidence * fix: bind summaries to current source evidence * fix: fence post content worker claims * fix: fence current vision projections * fix: serialize summary catalog writes * fix: separate vision proposals from row locks * fix: reuse prepared sibling organization aliases * fix: keep prepared hierarchy aliases distinct
The previous checkpoint closed the 20 keys AdminPanel.tsx references
as literal t("...") calls, but missed 33 more: its endpoint-catalog
and navigation-group metadata (ADMIN_LNB_GROUPS, ADMIN_OPERATIONS) is
defined as label/description/note fields on data arrays, rendered via
t(item.label) -- a literal-string grep can't see through the variable
indirection. Two of the 33 (Rankings, Workspace) were written as
unquoted object keys and weren't even in Korean yet.
Found this second slice by grepping the component's own data arrays
directly instead of its t("...") call sites. Translated all 33 into
zh/ja/vi matching the file's established terminology, and extended the
adminPanelLabels parity test to all 53 of AdminPanel's live keys.
Confirmed RED (falls back to English) before GREEN.
~64 other pre-existing ko-only keys (mostly in App.tsx) remain a
separate, tracked, not-yet-closed gap.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011EP69xAyLaJxa6oaF6D9eq
ADR 0049 leftover pair copy names the post and criterion only. Saved IRT scores stay visible when the evaluation channel is down. Post-content worker tests pass factory callables without lambda wrappers.
Record exact continuation head 154a13e, leftover next-action close, leftover-map TypeScript repairs, and the current open-PR SHA listing.
* feat: remember login return path before OIDC redirect (v2.12.19) Unauthenticated Log in now stores a validated same-origin return path (ADR 0119 / 0109) before signinRedirect, so a shared /?post= link still opens that post after callback. Tenant admin settings stay off the signed-out login shell so tsc -b type-checks. Independent of leftover-map PRs. Do not invent a leftover score or a theta. Synthetic fixtures only. * docs: reuse OIDC deep-link decision * fix: remember login return path on every OIDC start Stack onto the workspace branch without force-push. Persist a validated same-origin path before redirect so a shared post link survives callback when OIDC state is missing. Admin settings stay unmounted until login. --------- Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
…ions read_customer_master (GET /api/customer-master, ADR 0125) passed entity_ids -- the endpoint's broad Customer Master listing, which also includes entities the account merely *observes* (mentioned in a visible post, never actually affiliated with) -- into fetch_relationship_network as its ABAC scope parameter. fetch_relationship_network's SQL treats corporate_entity_ids exactly like _can_see_post's `post.corporate_entity_id = any($1)` clause, so passing the broader observed-inclusive listing let a private post owned by one of those observed-only entities leak its counterparty classification into relationship_network -- a real cross-tenant data leak, not just an over-broad display list. The pre-existing giant Customer Master contract test (test_customer_master_returns_authorized_catalog_contract) did not catch this: its `"Private Other Corp" not in network` assertion passed only incidentally, because the demo-vs-real-data source-context eligibility heuristic (SOURCE_POST_ELIGIBILITY_SQL) happened to already exclude the relevant fixture post for an unrelated reason. Fix: scope the call to account.corporate_entity_ids (the account's own real affiliations), net of the same synthetic-only/stale-demo-grant exclusion (fetch_demo_corporate_entity_ids) the entity tree query just above it already applies once real source context exists. An initial fix using the raw account.corporate_entity_ids list (without that exclusion) still let a stale demo grant leak back in -- caught by the existing giant contract test failing after the fix, corrected before this commit. Added a new focused regression test that deliberately defeats the demo-vs-real eligibility heuristic (giving both the mentioning and the mentioned posts real source context) to isolate the ABAC-scoping behavior being tested, independent of the heuristic. Verified RED against pre-fix code (both the scope-widening leak and the observed-corp capture assertion failed), GREEN after. Full suite: 1032 passed, 17 skipped, no regressions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011EP69xAyLaJxa6oaF6D9eq
SourceResearchPanel's load callback had no request-id guard on its fetchPostSourceResearch call. Switching posts quickly (or the runResearch -> load refresh racing a still-in-flight initial load) could let an earlier post's response resolve after the panel had already moved to a newer post, rendering the wrong post's persisted source research. Added the same requestIdRef counter/compare guard already used elsewhere in App.tsx (historyRequestIdRef, relatedRequest, postsRequest): each call to load() claims a new request id, and every state-setting branch (success, error, and the loading finally) checks it's still current before applying. Found by the same lineageweave-bug-sweep Workflow finder that surfaced the Customer Master ABAC leak fixed in the previous commit. Added a regression test that starts a slow post-1 fetch, switches to post-2 before it resolves, then resolves the stale post-1 response and asserts its lead never renders. Confirmed RED against pre-fix code (the stale lead rendered), GREEN after. Full frontend suite: 361 passed, lint clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011EP69xAyLaJxa6oaF6D9eq
Root-caused the reader-reported Event Lineage entanglement bug: reconstruct_group_key's process_unit_id fallback creates a multi-thousand-post mega-group, and channels.py's text_similarity_score is difflib character-overlap rather than embeddings, so temporally-close but topically-unrelated posts clear the 0.3 min_fused_score floor when no AdjudicationClient is configured. Independent of the open PR wiring AdjudicationClient into rebuild_lineage(); both causes above remain open after that PR merges.
Second gap-baseline i18n slice: 22 keys used by the Board hand-off prompt, R&R semantic-relationship predicates (Responsible for, Supports, Organization member/unit of, Sub-organization of), the evidence workspace, and AdminPanel's Account/Permissions/routes fields were ko-only, silently falling back to the raw English key in zh/ja/vi. Extends the i18n.test.ts parity check the same way the prior AdminPanel slice did. Source-lineage-hints-panel keys are a separate concurrent slice on this branch, not touched here.
backfill_post_keymen.py and requeue_failed_post_content.py were the only scripts/ entries without the repo-root sys.path insert their siblings use, so `python scripts/<name>.py` failed with ModuleNotFoundError: backend unless a caller manually exported PYTHONPATH=. first. Match the existing pattern instead of documenting the workaround. Found while re-running backfill_post_keymen.py to refresh a stale reason_no_live_client role row now that the local orchestrator/searxng services are reachable.
|
Important Review skippedToo many files! This PR contains 306 files, which is 206 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (306)
You can disable this status message by setting the 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. Comment |
|
#570이 이 PR의 유일한 신규 내용(팁 커밋 3d93ea9, 12줄)을 fresh main 위에서 동일하게 전달하며 MERGEABLE 상태입니다. 이 브랜치는 main 대비 49파일 충돌·~800 스택 커밋으로 리베이스 비용이 내용을 초과해 닫습니다. 브랜치는 보존됩니다 — 스택의 다른 내용이 필요하면 재개하세요. |
Summary
scripts/backfill_post_keymen.pyandscripts/requeue_failed_post_content.pywere the only two entries inscripts/without the repo-rootsys.pathinsert their siblings already use, sopython scripts/<name>.pyfailed withModuleNotFoundError: backendunless a caller manually exportedPYTHONPATH=.first.backfill_post_keymen.pyto refresh a stalereason_no_live_clientrole row for a specific post now that the local orchestrator/searxng services are reachable — the script itself couldn't even start without the workaround.Test plan
python -m py_compileboth edited scriptsModuleNotFoundErrorwhen running the script from repo root withoutPYTHONPATHset🤖 Generated with Claude Code