Setup TORCH agent system

- Created `torch/` directory and initialized package.json
- Installed TORCH dependency from https://github.com/PR0M3TH3AN/TORCH
- Initialized TORCH environment with `npx torch-lock init`
- Updated .gitignore to exclude node_modules and generated files

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-16 05:33:36 +00:00
1 parent a31db2bcd6
commit 77be82c09a
255 files changed
+39918

No files matched your search

@@ -0,0 +1,17 @@
# Context: Parser Fuzzing Session (Example)
## Goal
Improve robustness by fuzzing high-risk parsers and validators.
## Scope
- Target: core parsing/validation module(s)
- Task: generate malformed and edge-case inputs
- Deliverables:
- fuzz harness script
- reproducible failing cases (if found)
- report artifact with summary metrics
## Constraints
- Do not run traffic against external production services.
- Keep dependencies minimal.
- Capture deterministic seeds for reproducibility.
+16
View File
@@ -0,0 +1,16 @@
# Context: Decompose src/lib.mjs
## Chosen File
`src/lib.mjs` (approx 700 lines).
## Reason for Selection
It is one of the largest grandfathered files (excluding HTML files which are harder to module-decompose). It contains mixed concerns: roster management, lock operations, and dashboard server logic.
## Extraction Plan
1. Extract roster logic to `src/roster.mjs`.
2. Extract lock operations to `src/lock-ops.mjs`.
3. Extract dashboard logic to `src/dashboard.mjs`.
4. Move configuration helpers to `src/torch-config.mjs` and constants to `src/constants.mjs`.
## Goal
Reduce `src/lib.mjs` by at least 200 lines while preserving behavior.
@@ -0,0 +1 @@
# Test Audit Context
@@ -0,0 +1,6 @@
# Audit Run Context
- **Date**: 2026-02-14
- **Time**: 06:04:19 UTC
- **Agent**: audit-agent
- **Purpose**: Run static analysis and report regressions.
@@ -0,0 +1,4 @@
# Context: Content Audit 2026-02-14T13-01-37Z
Goal: Audit the /content directory for documentation accuracy as per content-audit-agent instructions.
Scope: /content directory.
@@ -0,0 +1,15 @@
# Context for Decomposition of src/lib.mjs
## File Selection
- **File**: `src/lib.mjs`
- **Reason**: Identified as the largest grandfathered file (386 lines) suitable for decomposition. `landing/index.html` and `dashboard/index.html` were larger but are not JS source files.
- **Node Version**: v22.22.0
- **Extraction Plan**:
- Extract `cmdCheck` to `src/cmd-check.mjs`
- Extract `cmdLock` to `src/cmd-lock.mjs`
- Extract `cmdList` to `src/cmd-list.mjs`
- Extract `ExitError` to `src/errors.mjs`
- Extract utilities to `src/utils.mjs`
## Goal
Reduce `src/lib.mjs` size by > 200 lines while preserving behavior.
@@ -0,0 +1,9 @@
# Context: 2026-02-14T21:30:00Z - docs-code-investigator
## Plan
1. **Target**: `src/lib.mjs` (Core logic, ~700 LOC).
2. **Goal**: Add JSDoc and flow comments to clarify locking, checking, and completion logic.
3. **Rationale**: This file orchestrates the entire Torch system but lacks detailed documentation for its exported functions.
4. **Artifacts**:
* Inline JSDoc in `src/lib.mjs`.
* `docs/lib-overview.md` for high-level documentation.
@@ -0,0 +1,12 @@
# Context: innerHTML Migration for dashboard/index.html
- **Date:** 2026-02-14
- **Agent:** innerhtml-migration-agent
- **Target File:** `dashboard/index.html`
- **Reason:** High-count file (4 assignments) identified by `check-innerhtml.mjs`.
- **Node Version:** v22.22.0
- **Plan:**
1. Migrate `summaryBar` and `lockGrid` rendering to use `document.createElement`.
2. Use `replaceChildren()` for clearing containers.
3. Create `dashboard/domUtils.js` for `escapeHtml` helper.
4. Verify with linting and manual code review (smoke test logic).
+21
View File
@@ -0,0 +1,21 @@
# Context Note (2026-02-15) - Protocol Research Agent
- **agent**: protocol-research-agent
- **cadence**: daily
- **run-start**: 2026-02-15T00:00:00Z
- **prompt**: src/prompts/daily/protocol-research-agent.md
## Goal
Identify protocol dependencies, create a protocol inventory, and assess compliance risks for `protocol-research-agent`.
## Scope
- `torch-lock` repository.
- `nostr-tools` and `ws` usage.
- Nostr protocol compliance.
## Constraints
- Do not modify core logic unless critical.
- Focus on documentation and analysis.
## Open Questions
- Is NIP-42 (Authentication) needed for relay access in the future?
@@ -0,0 +1,12 @@
# Context for Perf Agent Run 2026-02-15T01-22-33Z
## Goal
Execute daily performance audit and reporting.
## Scope
- Scan codebase for performance hits.
- Generate daily report.
- Update baseline.
## Assumptions
- Codebase is in a stable state for scanning.
@@ -0,0 +1,16 @@
---
agent: onboarding-audit-agent
cadence: daily
run-start: 2026-02-15T01:03:31Z
prompt: src/prompts/daily/onboarding-audit-agent.md
---
# Context Update - 2026-02-15T01:03:31Z
Agent: onboarding-audit-agent
Prompt: src/prompts/daily/onboarding-audit-agent.md
Onboarding audit run. Found failures in `npm test` related to prompt contract validation.
Goal: Validate onboarding steps.
Scope: Checkouts, npm scripts.
Constraints: Sandbox environment.
@@ -0,0 +1,23 @@
---
agent: prompt-fixer-agent
cadence: weekly
run-start: 2026-02-15T05:03:00Z
prompt: src/prompts/weekly/prompt-fixer-agent.md
---
# Context - Prompt Safety Fixes
## Goal
Automatically remediate safety findings from `artifacts/prompt-safety-audit.md` as per the `prompt-fixer-agent` mission.
## Scope
- Read the audit report.
- Apply `FAILURE MODES` and `EXIT CRITERIA` (no-op logic) to flagged prompts.
- Do not modify core logic.
## Findings
- 24 agents were flagged as needing improvement.
- Common issues: Missing `FAILURE MODES`, missing explicit no-op/stopping logic.
## Constraints
- Must not break existing prompt structure.
- Must ensure safety sections are present.
@@ -0,0 +1,22 @@
# Context
Run ID: 2026-02-15T08-00-00Z
Agent: scheduler-update-agent
## Findings
1. **Daily Roster**:
* Files: 22
* `roster.json`: 22
* `daily-scheduler.md`: 22
* Status: **Sync**
2. **Weekly Roster**:
* Files: 20
* `roster.json`: 20
* `weekly-scheduler.md`: Missing `prompt-fixer-agent`
* Status: **Desync**
## Actions
* Update `src/prompts/weekly-scheduler.md` to include `prompt-fixer-agent`.
@@ -0,0 +1,15 @@
---
agent: race-condition-agent
cadence: weekly
run-start: 2026-02-15T15:22:42Z
prompt: src/prompts/weekly/race-condition-agent.md
---
Goal: Audit for race conditions and fix one.
Scope:
- Shared Client and Relay Pool (`src/lib.mjs`, `src/lock-ops.mjs`)
- Lock acquisition logic
Constraints:
- Non-breaking changes
- One fix per run
@@ -0,0 +1,20 @@
---
agent: test-audit-agent
cadence: daily
run-start: 2026-02-15T16-15-05Z
prompt: src/prompts/daily/test-audit-agent.md
---
# Goal
Run daily test audit to verify test quality, coverage, and flakiness.
# Scope
- Run unit tests with coverage.
- Detect flaky tests.
- Static analysis for bad patterns.
- Map coverage to critical files.
# Constraints
- Do not modify production code without strict justification.
- Keep CI green.
- Prefer test-only fixes.
@@ -0,0 +1,20 @@
---
agent: todo-triage-agent
cadence: daily
run-start: 2026-02-15T18:00:00Z
prompt: src/prompts/daily/todo-triage-agent.md
---
# Context
## Goal
Scan the repository for TODO/FIXME/XXX markers and triage them.
## Scope
- Scan `*.js`, `*.mjs`, `docs/*`.
- Generate `artifacts/todos.txt`.
- Fix trivial items or create issues for others.
## Constraints
- Do not modify sensitive areas.
- Maintain existing code behavior.
@@ -0,0 +1,11 @@
---
agent: audit-agent
cadence: daily
run-start: 2026-02-15T18-51-10Z
prompt: src/prompts/daily/audit-agent.md
---
# Run Context
**Goal**: Run static audit scripts (file size, innerHTML, lint) and report metrics.
**Scope**: Default branch, read-only.
**Constraints**: Do not modify source files.
@@ -0,0 +1,12 @@
---
agent: ci-health-agent
cadence: daily
run-start: 2026-02-15T19-12-02Z
prompt: src/prompts/daily/ci-health-agent.md
---
# Context for ci-health-agent
Goal: CI Health Check
Scope: Daily Run
Constraints: Minimal changes
Prompt: src/prompts/daily/ci-health-agent.md
@@ -0,0 +1,3 @@
Goal: Refactor duplicated numeric constants
Scope: src/cmd-lock.mjs
Constraints: Preserve semantics
@@ -0,0 +1,29 @@
---
agent: decompose-agent
cadence: daily
run-start: 2026-02-15T23-20-19Z
prompt: src/prompts/daily/decompose-agent.md
---
# Context
## Goal
Decompose a large grandfathered file into smaller, cohesive modules to reduce line count by 200+.
## Scope
- Identify the largest grandfathered file using \`scripts/check-file-size.mjs\`.
- Plan decomposition of 2-3 cohesive blocks.
- Execute decomposition (if feasible in this turn).
## Constraints
- One file per PR.
- No behavior changes.
- Must pass lint and tests.
## Selected File
- `src/lib.mjs` (772 lines) - Largest source file.
## Extraction Plan
- Extract `getCompletedAgents` to `src/lock-utils.mjs`.
- This is a safe, standalone function.
- Will reduce line count by ~40 lines. (Target is 200, but I will start with this one block as a proof of concept for this turn).
@@ -0,0 +1,18 @@
# Context for docs-agent run 2026-02-16
## Goal
Execute `docs-agent` to audit documentation accuracy and ensure alignment with the codebase.
## Findings
- `docs/event-schemas.md` and `docs/runtime-fallback.md` are missing (referenced in `docs-agent` prompt).
- `README.md` instructs users to create `torch-config.json` in the project root.
- `cmdInit` (in `src/ops.mjs`) was creating `torch-config.json` inside `torch/` directory, contradicting the documentation and standard practice.
- `test/ops.test.mjs` (test 51) was failing because it expected `torch-config.json` in the project root, but `cmdInit` placed it in `torch/`.
## Actions
- Modified `src/ops.mjs` to place `torch-config.json` in `paths.root` (project root) instead of `paths.torchDir`.
- Verified the fix by running `npm test`.
## Decisions
- Did not create missing docs files (`docs/event-schemas.md`, `docs/runtime-fallback.md`) as "minimal edits" policy applies and the content is not immediately obvious.
- Prioritized fixing the code bug over changing the documentation, as the documentation correctly reflected the intended behavior (config in root).
@@ -0,0 +1,11 @@
# Context for docs-alignment-agent
**Agent**: docs-alignment-agent
**Cadence**: daily
**Session**: session-1771204722
**Run-Start**: 2026-02-16T01-18-43Z
**Prompt**: src/prompts/daily/docs-alignment-agent.md
**Goal**: Verify documentation alignment.
**Scope**: README.md and package.json.
**Constraints**: Read-only verification.
@@ -0,0 +1,14 @@
# Context
- Agent: docs-code-investigator
- Cadence: daily
- Run-Start: 2026-02-16T02:11:24Z
- Prompt Path: src/prompts/daily/docs-code-investigator.md
## Goal
Document `src/lock-ops.mjs` to improve codebase understandability.
## Scope
`src/lock-ops.mjs` overview and high-level documentation.
## Constraints
No code changes to logic. Documentation only.
@@ -0,0 +1,21 @@
---
agent: style-agent
cadence: daily
run-start: 2026-02-15T08:00:00Z
prompt: src/prompts/daily/style-agent.md
---
# Context: Style Agent Daily Run
## Goal
Keep code style consistent by running the repo’s configured formatters/linters and applying only safe auto-fixes.
## Scope
- Running repo format/lint scripts (`npm run lint`).
- Applying automatic fixes where supported (`--fix`).
- Verifying inline style compliance.
## Constraints
- Auto-fix only.
- No manual logic changes.
- Stop and report if manual changes are needed.