← Back to Pull requests

feat(secrets): a marker needs a pointer; a signing secret left in the store is deleted later (W48, D1706, D1707) #337

Open
unknown opened this pull request with 289 lines diff across 3 files
View on GitHub
unknown unknown commented on Oct 28, 2026 20:07 UTC
Author

Round 6, W48, PR 7d of docs/plans/security.md. Stacked on #327 (base feat/w48-security, which writes D1706 and orchestration.md D1707).

Decisions

  • D1706 — isRedactedSecret (@jhin/host-api, re-exported by @jhin/client-api) reads ••••••#… as an addressed marker only when a JSON Pointer (#/…) follows; ••••••#note and ••••••# are values, saved and sealed like any secret. Deferred narrows to a real value starting ••••••#/.

  • D1707 (orchestration.md) — a signing secret the store could not delete (task deleted or signature removed while the store was unreadable, or a failed delete) is remembered in storage.kv (secret-orphans, task ids only) and deleted at the next activation of jhin.scheduler with a readable store; a task that holds a secret in the store again is dropped from the list without a delete; a delete that fails again stays listed. Deactivation waits for the sweep.
  • Evidence

    $ ~/.t3/jhin-heavy vp test run packages/node-host/test/secrets.test.ts packages/host-api/test
          Tests  35 passed (35)
    $ ~/.t3/jhin-heavy vp test run plugins/scheduler/test/webhook.test.ts -t "D1707|D1512"
          Tests  5 passed | 16 skipped (21)
    $ ~/.t3/jhin-heavy vp test run apps/web/test/config-form.test.ts
          Tests  26 passed (26)
    $ vp check docs/plans/security.md packages/host-api/src/index.ts packages/node-host/test/secrets.test.ts plugins/scheduler/src/index.ts plugins/scheduler/test/webhook.test.ts
    pass: All 5 files are correctly formatted
    pass: Found no warnings or lint errors in 4 files
    $ vp run --filter @jhin/plugin-scheduler --filter @jhin/host-api --filter @jhin/node-host --filter @jhin/web typecheck
    vp run: 4/4 successful.
    

    New tests:

  • secrets.test.ts — "takes a value that only starts like a marker as the value it is (security.md D1706)": ••••••#note and ••••••# restore as values, ••••••#/keys/0 keeps the stored secret.

  • webhook.test.ts — "deletes a secret the store could not delete at the next activation, unless its task holds one again (D1707)": the orphan list after an unreadable delete and signature removal, kept while the store stays unreadable, swept (the deleted task's secret gone, the re-signed task's kept, the list removed) on the next start.
  • 🤖 Generated with Claude Code

    Diff: 289 lines (+216 / -73) across 3 files Reviewer: claude[bot] Review duration: 2m
    All Vouch review confidence checks passed
    Residual risk 0.50 = Change Risk (0.68) × (1 − Review Confidence (0.26)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.68 · 289 lines diff across 3 files
    0.68
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 34% · Reviewer familiarity: 35%
    25%
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.339
    Sensitive Paths sensitive_paths
    0.068
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #337"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 25.9% reviewed sensitive_module
    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: 68% (HIGH) · Higher = larger blast radius
    68%
    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: 25.9% · Lower = rushed or shallow review
    25.9%
    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: 50.4% · Moderate risk
    50.4%
    Repository