Skip to content

fix: surface classification progress in ft status#102

Open
tw4dl wants to merge 4 commits intoafar1:mainfrom
tw4dl:codex/status-classifier-lock
Open

fix: surface classification progress in ft status#102
tw4dl wants to merge 4 commits intoafar1:mainfrom
tw4dl:codex/status-classifier-lock

Conversation

@tw4dl
Copy link
Copy Markdown

@tw4dl tw4dl commented Apr 16, 2026

Summary

  • surface category/domain completion counts in ft status
  • show when a classification job is currently running
  • guard classify/classify-domains with a lock file so concurrent runs fail fast instead of stepping on each other
  • add regression coverage for progress counting, lock lifecycle, and status rendering

Validation

  • npm test
  • npm run build

Note

Medium Risk
Adds cross-platform process/lock-file handling (including ps/PowerShell probes) and changes CLI execution flow, which could cause false-positive lockouts or platform-specific failures if process detection misbehaves.

Overview
ft status now surfaces classification completion counts (categories/domains) and reports an active classification job when one is running.

LLM classification commands (ft classify, ft classify-domains, and ft sync --classify) are wrapped in a new lock-file mechanism (classification-lock.json) to fail fast on concurrent runs and to clean up stale/malformed locks safely.

Adds getClassificationProgress() DB query support plus regression tests covering progress counting, lock lifecycle/staleness handling, and updated status output; README docs are updated accordingly.

Reviewed by Cursor Bugbot for commit 1c60738. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

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

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: 157079b2f2

ℹ️ 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".

Comment thread src/bookmark-classify-llm.ts Outdated
Comment thread src/bookmark-classify-llm.ts Outdated
Comment thread src/bookmark-classify-llm.ts
Copy link
Copy Markdown

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

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: e887039c62

ℹ️ 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".

Comment thread src/bookmark-classify-llm.ts Outdated
Comment thread src/bookmarks-db.ts Outdated
Copy link
Copy Markdown

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

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: 1c607388b3

ℹ️ 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".

Comment thread src/bookmark-classify-llm.ts Outdated
Comment thread src/bookmark-classify-llm.ts Outdated
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1c60738. Configure here.

Comment thread src/bookmarks-service.ts
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 16, 2026

You have used all of your free Bugbot PR reviews.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
Copy Markdown

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

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: 6186f4776a

ℹ️ 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".

}

const liveProcessStartedAt = processStartedAt(raw.pid);
if (liveProcessStartedAt && liveProcessStartedAt !== normalizedProcessStartedAt) {
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 Treat unknown process start time as an invalid lock owner

If processStartedAt(raw.pid) fails (for example, PowerShell is unavailable or ps output is unparseable), this branch skips the start-time comparison and keeps the lock active based only on PID liveness; a recycled PID can then block new classify/classify-domains runs even though no classification job is running. Fresh evidence in this revision is that stale-lock cleanup is gated by liveProcessStartedAt && ..., so probe failures still fall back to PID-only behavior.

Useful? React with 👍 / 👎.

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.

1 participant