Skip to content

Add initial TriggerMind project skeleton (CLI, scheduler, storage, models, tests)#5

Open
Sunnylincc wants to merge 1 commit intomainfrom
codex/build-triggermind-cli-project-51qv4h
Open

Add initial TriggerMind project skeleton (CLI, scheduler, storage, models, tests)#5
Sunnylincc wants to merge 1 commit intomainfrom
codex/build-triggermind-cli-project-51qv4h

Conversation

@Sunnylincc
Copy link
Owner

Motivation

  • Bootstraps the TriggerMind project with a local-first, trigger-based agent MVP and developer tooling.
  • Provide a minimal, self-contained CLI and background scheduler so users can create timer and absolute-time reminders.
  • Define stable on-disk state, simple JSON storage, and abstractions to make future trigger types and backends pluggable.
  • Include packaging, docs, and contribution guidance to make the repo usable and testable out of the box.

Description

  • Add CLI entrypoint and commands in triggermind/main.py with interactive guide, start, at, list, cancel, doctor, and update actions.
  • Implement core runtime modules: models (TriggerRecord), JSON-backed store (storage/json_store.py), time parsing (timeparse.py), trigger factories (triggers/*), scheduler daemon (scheduler/daemon.py), notifications (notifications/manager.py), and filesystem helpers (paths.py).
  • Provide developer and packaging files: pyproject.toml, README.md, CONTRIBUTING.md, LICENSE, install scripts (scripts/install.sh, scripts/install.ps1), and a .gitignore.
  • Add a tiny offline-compatible typer shim and test helpers plus unit tests under tests/ covering CLI flows, store operations, and time parsing; also add docs docs/ARCHITECTURE.md and trigger stubs for roadmap clarity.

Testing

  • Ran pytest which executed tests/test_timeparse.py, tests/test_store.py, and tests/test_cli.py.
  • All tests completed successfully (9 tests passed).

Codex Task

Copy link

@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: 69cb93c572

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

dirty = True

if dirty:
store.save(records)

Choose a reason for hiding this comment

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

P1 Badge Guard daemon writes against concurrent store updates

The scheduler writes back a full snapshot with store.save(records) after processing due triggers, but that snapshot was loaded earlier in the loop; if triggermind start, at, or cancel updates the JSON file between load and this save, the daemon overwrites those newer changes and silently drops user updates. Because the CLI and daemon are designed to run concurrently, this creates real data-loss races for scheduled/cancelled triggers.

Useful? React with 👍 / 👎.

info = default
if info.is_option:
param_names = info.param_decls or (f"--{param.name.replace('_', '-')}",)
cmd_func = click.option(*param_names, param.name, default=info.default, show_default=True, help=info.help, type=annotation)(cmd_func)

Choose a reason for hiding this comment

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

P1 Badge Preserve Typer boolean-flag semantics in the local shim

In the offline typer shim, options are always registered with type=annotation; for bool options this makes Click require an explicit value, so commands like triggermind list --all fail with Option '--all' requires an argument instead of acting as a flag. This breaks advertised CLI behavior whenever the project runs against the bundled shim (the exact mode this fallback is meant to support).

Useful? React with 👍 / 👎.

stderr=subprocess.DEVNULL,
)
finally:
print(f"\033[93m⚡ TriggerMind Intervention:\033[0m {message}")

Choose a reason for hiding this comment

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

P2 Badge Route notification fallback to a user-visible channel

The fallback path in send_notification only does a print(...), but the daemon process is launched detached with stdout/stderr redirected to daemon.log; when desktop notification commands are unavailable (for example Linux without notify-send), fired triggers are written only to the log and the user receives no visible reminder. That undermines the core reminder flow in non-desktop/minimal environments.

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