Skip to content

feat: Phase 1+2 Background Autonomy — FS Watcher + Continuous Learning Pipeline#2

Merged
OgeonX-Ai merged 10 commits into
masterfrom
audit/promptimprover-pr-update
Jun 15, 2026
Merged

feat: Phase 1+2 Background Autonomy — FS Watcher + Continuous Learning Pipeline#2
OgeonX-Ai merged 10 commits into
masterfrom
audit/promptimprover-pr-update

Conversation

@OgeonX-Ai

@OgeonX-Ai OgeonX-Ai commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Phase 1 Background Autonomy - File System Watcher (AUTO-01, AUTO-02): FileWatcher class using chokidar v5 with two-layer noise filter (chokidar globs + in-process extension/segment checks). Meaningful extensions: .ts, .js, .md, .txt, .prompt. Integrated into server startup, 5 Vitest tests.
  • Phase 2 Continuous Learning Pipeline (AUTO-03, AUTO-04): GitPoller polls CommitIngester.ingestLatest every 30s; emits commits event when new commits detected, wiring BackgroundAutonomyService trigger pipeline. gitPollIntervalMs defaults to null (safe for fake-timer tests). 8 new tests for GitPoller.

Test plan

  • npm test passes 122/122 tests
  • GitPoller emits commits only when ingestLatest returns > 0
  • BackgroundAutonomyService uses file-change debounce + git polling together
  • Production server passes 30000ms to enable polling

Generated with Claude Code

Aitomates and others added 2 commits June 14, 2026 15:24
- FileWatcher class: chokidar v5 wrapper, two-layer noise filter
- Ignores: node_modules, dist, .git, logs, tmp, coverage
- Watches: ts, js, md, txt, prompt files
- 5 new Vitest tests; 48 total passing
- Wired into server init via RuntimeLogger + CommandCenterDashboard

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6402966787

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


/** Paths and patterns passed to chokidar `ignored` option (AUTO-02). */
const CHOKIDAR_IGNORE: (string | RegExp)[] = [
"**/node_modules/**",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Replace unsupported glob-string ignore matchers

This package locks Chokidar 5.0.0, where string ignored matchers compare exact paths rather than interpreting glob syntax, so patterns such as **/node_modules/** never match. The later in-process filter suppresses emitted events, but Chokidar still recursively scans and watches .git, node_modules, dist, and coverage, causing substantial startup/resource usage and potentially exhausting file-watch handles on normal large repositories. Use function, regex, or recursive path matchers supported by Chokidar v5.

Useful? React with 👍 / 👎.

this.inner.on("unlink", (filePath) => this.emitChange("unlink", filePath));
this.inner.on("error", (err: unknown) => {
RuntimeLogger.error("[FileWatcher] Watcher error", err);
this.emit("error", err instanceof Error ? err : new Error(String(err)));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid re-emitting watcher errors without a listener

When Chokidar reports an operational error such as an exhausted watch limit, this re-emits Node's special error event, but the server integration in src/index.ts registers only a change listener. An error event without a listener throws synchronously and terminates the MCP server, so a recoverable watcher failure becomes a full service crash; either handle the event at integration or do not re-emit it after logging.

Useful? React with 👍 / 👎.


// AUTO-02: segment-level noise filter
for (const seg of NOISE_PATH_SEGMENTS) {
if (normalised.includes(`/${seg}/`) || normalised.includes(`/${seg}`)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match exact relative path segments before filtering

This prefix-style check rejects meaningful files whose path merely starts with a noise-segment name, and it also checks parent directories outside the watched root because Chokidar supplies absolute paths. For example, every event under /workspace/distribution-app, any repository located below /tmp/dist, and a valid file such as /repo/src/coverage-helper.ts is silently discarded. Compute the path relative to rootPath and reject only exact directory segments.

Useful? React with 👍 / 👎.

…sponses, core refinements

Prior audit session (F-01 through F-08) left code fixes unstaged.
Includes semantic-provider.ts, structured-response.ts, and updates to
config, dashboard, server, history, lesson extraction, and refiners.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@OgeonX-Ai OgeonX-Ai enabled auto-merge (squash) June 14, 2026 18:58
Aitomates and others added 7 commits June 14, 2026 22:07
…TO-03/04

- GitPoller (src/history/git-poller.ts): polls CommitIngester.ingestLatest every
  30s in production; emits commits event when new commits detected (AUTO-03)
- BackgroundAutonomyService: wires GitPoller via optional gitPollIntervalMs param
  (null = disabled, safe for fake-timer tests); server.ts passes 30_000 (AUTO-04)
- 8 new tests in git-poller.test.ts: poll/event/error/start/stop/idempotent
- 122/122 tests green

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@OgeonX-Ai OgeonX-Ai changed the title feat: Phase 1 Background Autonomy — Real-time File System Watcher (AUTO-01, AUTO-02) feat: Phase 1+2 Background Autonomy — FS Watcher + Continuous Learning Pipeline Jun 15, 2026
@OgeonX-Ai OgeonX-Ai merged commit 95be5e9 into master Jun 15, 2026
7 checks passed
@OgeonX-Ai OgeonX-Ai deleted the audit/promptimprover-pr-update branch June 15, 2026 10:16
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