Skip to content

feat(cli): add one-way mem put --watch (#110) - #225

Merged
waterbro-8 merged 1 commit into
bytefolk:mainfrom
sun-970:feat/110-put-watch-20260920
Sep 22, 2026
Merged

waterbro-8 merged 1 commit into
bytefolk:mainfrom
sun-970:feat/110-put-watch-20260920

Conversation

@sun-970

@sun-970 sun-970 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Tracking record

Refs #110. Implements R2/R3 (waterbro-8). Consumes server/internal/ingest from #111 / PR #217.

Summary

mem put <path> --watch is a foreground poll watcher:

  • D-1: no daemonize/fsnotify; --interval default 30s; single-instance flock; SIGINT/SIGTERM exit 0 between cycles
  • D-2: per-cycle stdout report (--format json); JSONL under CLI state root capped at 200 cycles
  • D-3/R3: ingest new files after one quiet interval; changed files are reported not re-ingested; local_gone issues no delete
  • D-4: Walk/cursor/Classify/Run from the shared ingest core; file-plane multipart sink only
  • Closed failure codes: auth, plan_quota, provider_timeout, network, read_denied, upload_rejected, root_missing, state_corrupt

Out of scope: bidirectional sync, deletion propagation, Phase 2 sync drive, file revisions.

Validation ledger

ID AC Command Result
V1 AC-001,002,003,005,006,007,009 go test ./cmd/mem/ -run TestWatch PASS
V2 ingest core unchanged for qoder go test ./cmd/mem/ ./internal/ingest/ PASS

@sun-970

sun-970 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

@waterbro-8 please review. Fork PR; I cannot request reviewers on this repo.

@waterbro-8 waterbro-8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review APPROVE (not product 验收).

One-way put --watch is scoped correctly: quiet-interval ingest, no remote DELETE on local_gone, changed files reported not reingested, lock, JSONL cap, tests for ingest/auth/changed/dedupe/lock/cancel.

Note: cycle uses context.Background(), so SIGINT waits for an in-flight upload. Fine for this minimal tier.

Please rebase onto current main (includes #222) — mergeStateStatus is BEHIND.

@sun-970

sun-970 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor Author

Rebased locally onto current main 7b8bad3 (#222). One commit, no conflicts.

Cannot push from this OAuth token: GitHub rejects updating .github/workflows/mcp-registry-publish.yml without workflow scope (the file lands because #222 is on main). maintainer_can_modify is on — please rebase from your side (or merge through main).

Local rebased heads:

@sun-970

sun-970 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

Tried again to unstick the behind-by-1 vs main 7b8bad3 (#222).

POST /repos/sun-970/mem/merge-upstream (branch=main) was rejected:

HTTP 422
refusing to allow an OAuth App to create or update workflow `.github/workflows/mcp-registry-publish.yml` without `workflow` scope
documentation_url: https://docs.github.com/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository

Local rebase onto current main is clean (one commit, no conflicts). Did not rewrite or push the feature commit — this OAuth token still lacks workflow scope, so any push that introduces the #222 workflow files is refused.

maintainer_can_modify is on. @waterbro-8 can rebase this branch (or merge through main) from the GitHub UI.

Local rebased heads (not pushed):

Foreground poll watcher consumes the shared ingest core. New files ingest
after one quiet interval; changed files are reported not re-ingested;
local deletes never propagate.
@waterbro-8
waterbro-8 force-pushed the feat/110-put-watch-20260920 branch from bf68d03 to 3bc3d58 Compare September 22, 2026 12:06
@waterbro-8
waterbro-8 merged commit ca6ed33 into bytefolk:main Sep 22, 2026
21 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