← Back to Pull requests

fix(lark): redact credentials from shared Lark sinks #8181

Closed
unknown closed this pull request without merging on Nov 07, 2026 07:46 UTC
View on GitHub
unknown unknown commented on Nov 06, 2026 12:05 UTC
Author

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Security hardening for the Lark presentation extension; no public issue was opened.

  • Goal/source and gap: Shared Kanban and Explore projection paths could serialize free-form Todo, worker-output, Evidence, Handoff, Explore and stage-document text without applying the canonical provider-credential shape owner. Shared visibility also stopped at top-level values, and the operator sync/seed/heartbeat commands did not consistently select the shared boundary.

  • Observable before -> after, with the validation row that proves it: Before, credential-shaped text could reach a shared Lark Base record or Explore surface and still be reported as public-safe. After, every affected record writer redacts canonical credential shapes before serialization; shared visibility recursively applies path/private-reference redaction to nested keys and values, and the operator commands propagate the selected visibility explicitly. tests/extensions/test_lark_shared_sink_redaction.py and tests/control_plane/test_public_safety_credential_shape_owner.py cover the before/after boundary.

  • Issue/task and intended base: No public issue; security hardening request. Intended base: upstream/main at ac6296225.
  • Author Declaration

  • Written by: model_agent (OpenAI Codex) at JasonBuildAI's direction.
  • Implemented against

  • Specification and revision: No public written specification; .github/SECURITY.md and the request in this PR are the basis.

  • Criteria:
  • | Criterion (spec clause) | Disposition | Symbol / path | Test or command |
    | --- | --- | --- | --- |
    | Shared Lark record writers remove canonical provider-credential shapes before serialization | implemented | loopx/extensions/lark/presentation/kanban.py | tests/extensions/test_lark_shared_sink_redaction.py |
    | Shared visibility redacts nested keys/values and preserves structurally valid record-link ids | implemented | _sink_safe_lark_values | tests/extensions/test_lark_shared_sink_redaction.py |
    | Operator sync, seed and heartbeat commands default to shared visibility and propagate it | implemented | loopx/cli_commands/lark_kanban.py | tests/extensions/test_lark_shared_sink_redaction.py |
    | Explore visual, stage-document and issue-fix paths use the same boundary | implemented | loopx/extensions/lark/presentation/explore_results.py, explore_stage_document.py, loopx/cli_commands/explore_feishu_commands.py | tests/extensions/test_lark_shared_sink_redaction.py |
    | Python and TypeScript credential-shape owners stay in sync | implemented | loopx/public_safe_text.py, loopx/control_plane/goals/vision_checkpoint.ts, packages/dsh-loopx-plugin/src/observer.ts | tests/control_plane/test_public_safety_credential_shape_owner.py |
    | Operator docs state the new default and residual limits | implemented | docs/integrations/lark-kanban-control-plane-adapter.md | documentation review |

  • Self-check before submission: Rebased onto ac6296225; ran the focused and adjacent Python suites, ruff, py_compile, root and plugin TypeScript typechecks, module ratchet, and public-boundary scan. Did not include live data, credentials, reproduction steps, or private paths. Historical rows already written to a shared Base are not automatically cleaned; exposed credentials still require revocation and rotation.
  • Scope And Continuation

  • Completed scope and remaining work: Complete for new writes in the affected Lark projection, Explore, operator sync and heartbeat paths. Historical shared records, exports, backups and already-exposed credentials require operational cleanup and rotation outside this code change.

  • Slice boundary / successor: N/A for code; advisory publication and release coordination remain with maintainers.
  • Default behavior change: sync-loopx-todos, seed-task, seed-cases and heartbeat now default to --sink-visibility shared. The explicit owner-only mode remains available when the target ACL is independently verified.
  • Validation

  • Tested revision: d2b6e838b607b633682536d9dcc08f79f12e358e

  • Run state: finished

  • Input classes: synthetic, public_fixture
  • | Check kind | Result | Public-safe evidence / limitation |
    | --- | --- | --- |
    | unit | passed | tests/extensions/test_lark_shared_sink_redaction.py and tests/control_plane/test_public_safety_credential_shape_owner.py: 175 passed. |
    | unit | passed | Shared stage SVG regression: real presentation bundle -> shared stage write path -> independent XML parser: 1 passed. |
    | unit | passed | Adjacent public-safety, Lark, Explore and presentation tests re-run after the review fix: 232 passed. |
    | integration | passed | Explore source-runtime route tests: 6 passed. |
    | static | passed | ruff, py_compile, git diff --check; root control-plane and plugin TypeScript typechecks. |
    | regression_parity | passed | Module metric ratchet and public-boundary scan passed after the reviewed ceiling update. |
    | manual | blocked | hot-path-interface-budget-smoke.py fails identically on pristine ac6296225 with entrypoint_missing; environment limitation, not this diff. |
    | static | blocked | CI kernel-static-checks fails on F841 at tests/control_plane/test_goal_create_completion.py:184; that file is unchanged here (last touched by #8178) and the identical failure reproduces on base ac6296225 (run 42313186589, job 128219540019). |
    | integration | blocked | dsh-loopx-plugin admission-closeout integration fails with invalid_schema; the same test fails identically on main at e7a6c8d5f (run 41961423900, job 127028426011). Linux CI passes observer.spec.ts 13/13. |
    | static | blocked | checks, pytest, stage2c-correctness-e2e and merge-gate fail only as downstream gates: checks requires kernel-static-checks success, stage2c-correctness-e2e requires the skipped stage2c result to be success, and the Python shards were skipped the same way on base ac6296225. |
    | unit | blocked | Local Windows dsh-loopx-plugin suite has pre-existing path-normalization failures; 200/208 plugin tests passed. |
    | integration | blocked | cli-output-budget-regression-smoke.py fails on pristine main because the base fixture lacks read_cli_context_for_oracle; unrelated to this diff. |
    | integration | passed | CI PostgreSQL authority real-server check passed. |

    UI Impact

  • UI impact: none

  • Before: N/A

  • After: N/A

  • First viewport and preview: N/A

  • States and viewports shown: N/A

  • Source data: none

  • Attention review: N/A

  • Craft review: N/A
  • Type of Change

  • Bug fix

  • New feature

  • Breaking change

  • Refactoring (no functional changes)

  • Documentation update

  • Test update
  • LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)

  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)

  • Capability or extension (providers, adapters, skills)

  • Public docs or presentation surface (README, protocols, dashboard)

  • Build, packaging, installer, or CI

  • Host or runtime integration
  • Technical Direction

  • Direction / acceptance reference, when applicable: Core control-plane hardening and operator-surface/IM integration. No roadmap id is claimed by this change.
  • Shared-authority RFC fixture impact

  • Production-scale fixture schema: N/A

  • Semantic dimensions changed, or reviewed no-impact rationale: N/A

  • Provider conformance arms run: N/A

  • Read-only legacy/file/PostgreSQL three-arm rehearsal: N/A
  • Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths (including .loopx/, .codex/goals/, and live ACTIVE_GOAL_STATE.md).

  • I did not duplicate maintainer-owned benchmark work unless a maintainer split out a public issue for it.

  • I kept the change scoped to the linked issue/task.

  • Existing English/Chinese RFC pairs (including ledger entries) both have a diff, and the local premerge check python3 scripts/check_rfc_bilingual.py --base origin/main --head HEAD passes, or no paired RFC changed.

  • I completed the visual evidence section for UI changes, or marked UI impact none.

  • Every commit includes a DCO Signed-off-by trailer (git commit -s).
  • Security Note

    This PR intentionally limits vulnerability detail. The affected surface is the shared Lark projection boundary; the fix is shape-based redaction, not a complete DLP system. Historical data and any credential that may already have reached shared storage require revocation and rotation rather than relying on this code change.

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: JasonBuildAI Review duration: 1181m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #8181"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%