mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-27 07:51:52 +00:00
4b6ed0b7e5f4f8204e400542ac30e8b5ed6c0183
TORCH: Task Orchestration via Relay-Coordinated Handoff
TORCH is a portable Nostr-based task locking toolkit for multi-agent coordination.
Installation
npm install https://github.com/PR0M3TH3AN/TORCH/archive/refs/heads/main.tar.gz
TORCH is distributed from GitHub tarballs and is not currently published to the npm registry.
Usage
CLI
The torch-lock CLI allows you to check, lock, and list tasks.
# Check locks for a specific cadence
npx --no-install torch-lock check --cadence daily
# Lock a task for an agent
AGENT_PLATFORM=codex npx --no-install torch-lock lock --agent docs-agent --cadence daily
# List all active locks
npx --no-install torch-lock list
# Mark a task as completed (permanent)
AGENT_PLATFORM=codex npx --no-install torch-lock complete --agent docs-agent --cadence daily
# Initialize TORCH in a new repository
npx --no-install torch-lock init
# Update TORCH configuration and scripts
npx --no-install torch-lock update
# Run the Dashboard
npx --no-install torch-lock dashboard
Memory CLI
The torch-lock CLI also supports memory operations:
# List memories (optional filters: --agent, --type, --tags, --pinned)
npx --no-install torch-lock list-memories --limit 5
# Inspect a specific memory
npx --no-install torch-lock inspect-memory --id <memory-id>
# Pin/Unpin a memory
npx --no-install torch-lock pin-memory --id <memory-id>
npx --no-install torch-lock unpin-memory --id <memory-id>
# Check memory stats
npx --no-install torch-lock memory-stats
Configuration (torch-config.json)
Create a torch-config.json file in your project root to configure TORCH for your repository. You can use the included torch-config.example.json as a template.
Configuration options:
nostrLock.namespace(d-tag/tag namespace)nostrLock.relays(array of relay URLs)nostrLock.ttlSeconds(lock duration in seconds)nostrLock.queryTimeoutMs(timeout for relay queries)nostrLock.dailyRoster/nostrLock.weeklyRoster(explicit rosters)dashboard.defaultCadenceView(daily,weekly, orall)dashboard.defaultStatusView(activeorall)scheduler.firstPromptByCadence.daily/.weekly(first prompt to run)scheduler.paused.daily/.weekly(array of agent names to pause locally)
Dashboard
The dashboard provides a live view of lock events.
npx --no-install torch-lock dashboard --port 4173
# Open http://localhost:4173/dashboard/
Environment variables
You can override configuration using environment variables:
NOSTR_LOCK_NAMESPACENOSTR_LOCK_RELAYS(comma-separated)NOSTR_LOCK_TTLNOSTR_LOCK_QUERY_TIMEOUT_MSNOSTR_LOCK_DAILY_ROSTER(comma-separated list of agents)NOSTR_LOCK_WEEKLY_ROSTER(comma-separated list of agents)TORCH_CONFIG_PATH(path to config file)AGENT_PLATFORM(platform identifier, e.g.codex)TORCH_MEMORY_ENABLED(true/false; global memory kill switch, defaults to enabled)TORCH_MEMORY_INGEST_ENABLED(true/falseor comma-separated canaryagent_idallow list)TORCH_MEMORY_RETRIEVAL_ENABLED(true/falseor comma-separated canaryagent_idallow list)TORCH_MEMORY_PRUNE_ENABLED(true,false, ordry-run)
Roster precedence
The lock CLI resolves roster names in this order:
NOSTR_LOCK_DAILY_ROSTER/NOSTR_LOCK_WEEKLY_ROSTER(comma-separated env overrides).torch-config.json(nostrLock.dailyRoster/nostrLock.weeklyRoster).src/prompts/roster.json(canonical scheduler roster included in the package).- Built-in fallback roster.
Included Resources
src/lib.mjs— Core library logic (can be imported in scripts)src/docs/TORCH.md— Protocol summary and usagesrc/prompts/— Generic scheduler prompts and flowskills/— Repository-local skill guides for agent onboarding and repeatable workflowsdashboard/— Static lock dashboard assets
NPM Scripts (for development)
If you are developing torch-lock itself:
npm run lock:check:dailynpm run lock:check:weeklynpm run lock:listnpm run dashboard:servenpm test(run unit tests)npm run lint(run linter)
Memory rollout plan
- Deploy memory schema changes with scheduler jobs disabled (
TORCH_MEMORY_ENABLED=falseor subsystem flags set tofalse). - Enable ingest for one canary
agent_idviaTORCH_MEMORY_INGEST_ENABLED=<agent_id>. - Validate retrieval quality and storage growth metrics before expanding scope.
- Enable broader retrieval (
TORCH_MEMORY_RETRIEVAL_ENABLED=<allow-list>thentrue). - Enable pruning in
dry-runmode first, then switch to active pruning after revalidation.
Memory rollback plan
- Disable memory flags (
TORCH_MEMORY_ENABLED=falseand/or set ingest/retrieval/prune flags tofalse). - Stop memory maintenance scheduler processes.
- Preserve database state for post-incident analysis; do not drop or rewrite memory tables during rollback.
- Keep prune actions in
dry-run(or disabled) until lifecycle policy and data integrity are revalidated.
Description
Task Orchestration via Relay-Coordinated Handoff
Readme
MIT
9.7 MiB
0 Stars
1 Watchers
0 Forks
Languages
JavaScript
89.9%
HTML
7.6%
Python
1.3%
CSS
1.2%