Skip to content

feat(site-memory): add local self-learning browser memory - #475

Merged
beubax merged 41 commits into
mainfrom
feat/local-self-learning-browser
Sep 2, 2026
Merged

feat(site-memory): add local self-learning browser memory#475
beubax merged 41 commits into
mainfrom
feat/local-self-learning-browser

Conversation

@ankitranjan7

@ankitranjan7 ankitranjan7 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Description

Adds invisible, local-first self-learning memory to the browser workflow. The change introduces safe product identity resolution, optional seed initialization, candidate capture/search, conflict-aware checkpointing, progressive-disclosure limits, local CLI commands, and a single generated webcmd-browser skill contract.

Remote seed lookup is explicit configuration: WEBCMD_GLOBAL_MEMORY_URL enables one bounded first-access request, an absent or blank URL means zero seed requests and local-only learning, and WEBCMD_GLOBAL_MEMORY=off overrides a configured URL. No local seed service is started.

The implementation keeps hosted behavior compatible, preserves local drafts and unrelated Git state, avoids repeat seed lookups once local memory exists, and records explicit post-rewrite state for the 200-line cap.

Related issue: none

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🌐 New site adapter
  • 📝 Documentation
  • ♻️ Refactor
  • 🔧 CI / build / tooling

Checklist

  • I ran the checks relevant to this PR
  • I updated tests or docs if needed
  • I included output or screenshots when useful
  • If I edited skill-src/, I ran make build and committed skills/

Adapter Notes

  • Updated generated or lean docs when command discoverability changed
  • Used positional args for the command's primary subject unless a named flag is clearly better
  • Normalized expected adapter failures to CliError subclasses instead of raw Error

Verification

Node 22.17.0:

  • npm test — 176 files passed; 3,332 tests passed; 1 skipped
  • npm run typecheck
  • npm run build
  • make verify
  • npm run check:codex-plugin
  • git diff --check

Independent Claude Opus review verdict: SHIP.

Screenshots / Output

No UI changes.

Walk parent hostnames to the PSL registrable-domain boundary instead of
jumping to the apex, so admin.eu.example.com prefers eu.example.com.
…itory lock

Hold the repository lock across the post-acquire manifest re-check, seed writes, nested commit, and failure cleanup so a losing cold init cannot unlink the winner's committed files. Ignore ENOENT only during cleanup.
Write snake_case candidate JSON through an explicit codec, reject untrusted loads, serialize capture write+commit under the repository lock with own-file cleanup, and hard-cap search at 20.
If index restore also fails after a commit error, throw AggregateError with both causes instead of swallowing cleanup.
Restore prior Markdown and delete new paths if the memory commit fails, combining rollback errors. Reuse parseProductManifest, recover partial provenance without replaying memory, and require ingestion dispositions plus a real memory change.
Persist unattempted seed manifests, apply changed drafts during
provenance recovery, classify same-product vs distinct hosts, scope
dirty checks, and honor 500/200 plus structural Markdown dates.
Give each reference an explicit trigger, classify before write on
provisional fallbacks, state the 500/200 rewrite rule, and disclose
the ipify lookup with WEBCMD_CANDIDATE_PUBLIC_IP=off.
…alone

Keep product-scoped dirty checks, then reject any staged path outside
the commit allow-set. Create the canonical .gitignore only when absent.
Durable facts in nested lists, numbered lists, blockquotes, and table
data rows need [verified YYYY-MM-DD]. Pointer-bearing SITE.md stays
at or below 200 lines at any current length.
Context writes SITE and reference drafts only when absent so conflict
retry reuses the edited draft. Distinct classify keeps incompatible
beta SITE.md read-only. Unattempted seed status is retried once lookup
is enabled. Classify rollback surfaces AggregateError on cleanup failure.
Retry unattempted seeds only when no active local SITE.md exists, so
normal browser runs keep local product memory and skip the seed endpoint.
…ence

Gate the 200-line cap on optional manifest.postRewrite, set atomically
on rewrite commit. Pointer-bearing organic SITE.md can still grow to
500. Conflict retry re-applies the intended edit onto refreshed
siteMarkdown.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🟠 Maintainer review suggested — low confidence

The automated review could not reach a fully supported conclusion.

Limitations

  • The automated review returned an invalid structured result.

This review is advisory and does not block merging.

Windows shard 1/2 hits Vitest's 5s default on four sequential git.exe
tests; afterEach EBUSY is the timeout cascade. Match the existing
20s convention from candidates.test.ts without a global bump.
Windows shard 1/2 still hits Vitest's 5s default on the same-date
evidence integration test; afterEach EBUSY is the timeout cascade.
Match e0d67bb's 20s convention without a global bump.
Windows shard 1/2 hits the 20s cap on the 23-commit search-limit test
and Vitest's 5s default on the rewrite-cap test; afterEach EBUSY is
the timeout cascade. Match the 20s convention for rewrite, give the
serialized capture batch more room without a global bump.
@beubax
beubax merged commit 018b723 into main Sep 2, 2026
15 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.

2 participants