Skip to content

feat(onboarding): context-seed pipeline (Stage 3) - #442

Merged
jeonghun-jj-lee merged 2 commits into
mainfrom
jeonghun-jj-lee/436-context-seed-pipeline
Aug 19, 2026
Merged

feat(onboarding): context-seed pipeline (Stage 3)#442
jeonghun-jj-lee merged 2 commits into
mainfrom
jeonghun-jj-lee/436-context-seed-pipeline

Conversation

@jeonghun-jj-lee

@jeonghun-jj-lee jeonghun-jj-lee commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements #436 — the context-seed pipeline that scans allowlisted AI-tool configs, redacts secrets, extracts profile facts and memory cards, and writes them through the existing onboarding event pipeline.

What's included

  • src/context_seed.ts — pure Node module (no VS Code deps):
    • SCAN_ALLOWLIST: data-driven config of scan roots + filenames
    • resolveAllowlist(): returns only existing files from the allowlist
    • readAndRedact(): size-capped read with secret redaction at read time
    • redactSecrets(): expanded SECRET_PATTERNS (sk- keys, AWS, Bearer, PEM, generic key=value)
    • extractFacts(): conservative fact extraction from markdown/JSON configs → profile + memory cards
    • writeSeeds(): group-selectable materialization via appendOnboardingEvent()

Acceptance Criteria coverage

AC Status
1. Opt-in model Tested (nothing-found path)
2. Allowlist-only scan Tested (resolveAllowlist)
3. Size cap Tested (truncation + flag)
4. Secret redaction Tested (6 pattern types)
5. Fact extraction + provenance Tested
6. Group deselection Tested
7. Event pipeline writing Tested (via mock appendFn)
9. Idempotency Handled by merge semantics
10. No broad dir walk Enforced by allowlist
11. Nothing-found message Tested (empty result)

Status: WIP (draft)

The core logic layer is complete and tested (27 tests). Remaining for full closure:

  • Score-stage wiring (adding Stage 3 to the overture SCORE.md)
  • Integration test with real appendOnboardingEvent + distiller trigger

Closes #436

Summary by CodeRabbit

  • New Features

    • Added an optional onboarding step to scan approved AI-tool configuration files.
    • Users can review grouped profile and project information with source details before selectively importing it.
    • Imported information is sanitized to remove credential-like secrets and avoid duplicate entries.
    • Declining the scan performs no file reads, while missing files are reported accurately.
  • Bug Fixes

    • Onboarding completion is now recorded after the context-seeding choice is completed.

#436)

- Allowlist-driven file scanner (data-driven roots + filenames)
- Secret redaction at read time (expanded SECRET_PATTERNS)
- Size-capped reads (50KB default, truncated flag)
- Fact extractor: profile identity + memory cards from markdown/JSON configs
- writeSeeds: group-selectable materialization via appendOnboardingEvent
- 27 unit tests covering AC1-AC11
- WIP: score-stage wiring and integration test deferred
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ce0cc79-6a37-4a9e-8d5c-6815ad718821

📥 Commits

Reviewing files that changed from the base of the PR and between e5fc625 and d1eb0e9.

📒 Files selected for processing (4)
  • packages/extension/scores/overture/SCORE.md
  • packages/extension/src/context_seed.ts
  • packages/extension/test/context_seed.test.ts
  • packages/extension/test/scores/golden/compile-chained.md

📝 Walkthrough

Walkthrough

The change adds an opt-in context_seed onboarding stage. It scans allowlisted AI-tool files, redacts secrets, extracts grouped facts with provenance, supports selective idempotent imports, and records completion after acceptance or decline.

Changes

Context-seed onboarding

Layer / File(s) Summary
Scan, extract, and write context seeds
packages/extension/src/context_seed.ts, packages/extension/test/context_seed.test.ts
The pipeline scans allowlisted files with a 50 KB cap, redacts credentials at read time, extracts profile and memory facts, and writes selected seeds through onboarding events. Tests cover scanning, redaction, extraction, deselection, counts, and end-to-end behavior.
Opt-in Overture stage
packages/extension/scores/overture/SCORE.md, packages/extension/test/scores/golden/compile-chained.md
The onboarding flow asks for consent after intent selection, skips reads on decline, presents provenance-grouped previews on acceptance, handles empty scans, and records completion after the stage.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related issues

  • harmoniqs/amicode issue 438 — This pipeline can provide the seeded entities that the issue expects later onboarding stages to use.

Possibly related PRs

Suggested reviewers: aarontrowbridge

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Overture
  participant ContextSeed
  participant OnboardingEvents
  User->>Overture: accept or decline context scanning
  alt accepted
    Overture->>ContextSeed: scan allowlisted files
    ContextSeed-->>Overture: redacted grouped preview
    User->>Overture: select seed groups
    Overture->>ContextSeed: write selected seeds
    ContextSeed->>OnboardingEvents: append onboarding events
  else declined
    Overture->>Overture: skip file reads
  end
  Overture->>OnboardingEvents: record onboarding completion
Loading
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jeonghun-jj-lee/436-context-seed-pipeline

Comment @coderabbitai help to get the list of available commands.

- Add context_seed stage to SCORE.md frontmatter (optional, with opt-in question)
- Add Stage 3 body instructions: opt-in, scan, preview, confirm, constraints
- Regenerate golden parity files
- Completion marker moves after Stage 3 (Stages 4-8 in subsequent slices)
@jeonghun-jj-lee
jeonghun-jj-lee marked this pull request as ready for review August 19, 2026 19:36
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 77191d8 into main Aug 19, 2026
5 of 7 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.

Context-seed pipeline (Stage 3): scan, redact, preview, materialize

1 participant