mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-27 07:51:52 +00:00
feat: implement log-summary utility as feature-proposer-agent
Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
5196f264cb
commit
2ed1ae85a9
12 files changed
+313
No files matched your search
@@ -297,5 +297,56 @@
|
||||
"merged_into": null,
|
||||
"pinned": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"fd852345-c9c5-4c5c-8076-7e16a7b90016",
|
||||
{
|
||||
"schema_version": 1,
|
||||
"id": "fd852345-c9c5-4c5c-8076-7e16a7b90016",
|
||||
"agent_id": "feature-proposer-agent",
|
||||
"session_id": "session-1771346034",
|
||||
"type": "batch_window",
|
||||
"content": "Memory retrieval seed for weekly :: Required startup + artifacts + memory + issue capture",
|
||||
"summary": "Memory retrieval seed for weekly :: Required startup + artifacts + memory + issue capture",
|
||||
"tags": [
|
||||
"scheduler",
|
||||
"weekly",
|
||||
"retrieve"
|
||||
],
|
||||
"importance": 0.4,
|
||||
"embedding_id": null,
|
||||
"created_at": 1771346034674,
|
||||
"last_seen": 1771346034684,
|
||||
"source": "scheduler-retrieve",
|
||||
"ttl_days": null,
|
||||
"merged_into": null,
|
||||
"pinned": false
|
||||
}
|
||||
],
|
||||
[
|
||||
"abe5bddd-5b7a-4e18-aabf-9d517bd59a8e",
|
||||
{
|
||||
"schema_version": 1,
|
||||
"id": "abe5bddd-5b7a-4e18-aabf-9d517bd59a8e",
|
||||
"agent_id": "feature-proposer-agent",
|
||||
"session_id": "session-1771346112",
|
||||
"type": "batch_window",
|
||||
"content": "# Memory Update - Feature Proposer Agent\n\n**Date**: 2026-02-17T15-00-00Z\n**Agent**: feature-proposer-agent\n\n## Insights\n- The `task-logs` structure is consistent and easy to parse.\n- A simple CLI tool (`features/log-summary.mjs`) was added to visualize this data.\n- This pattern of \"small, standalone utility scripts\" in `features/` is effective for incremental improvement.\n\n## Actions\n- Implemented `features/log-summary.mjs`.\n- Verified with manual execution.\n\n## Recommendations\n- Future agents could enhance this script to filter by status (e.g., show only failed runs).",
|
||||
"summary": "# Memory Update - Feature Proposer Agent\n\n**Date**: 2026-02-17T15-00-00Z\n**Agent**: feature-proposer-agent\n\n## Insights\n- The `task-logs` structure is consistent and easy to parse.\n- A simple CLI tool (`features/log-summary.mjs`) was added to visualize this data.\n- This pattern …",
|
||||
"tags": [
|
||||
"scheduler",
|
||||
"weekly",
|
||||
"store",
|
||||
"insight"
|
||||
],
|
||||
"importance": 0.8,
|
||||
"embedding_id": null,
|
||||
"created_at": 1771346112755,
|
||||
"last_seen": 1771346112755,
|
||||
"source": "agent-output",
|
||||
"ttl_days": null,
|
||||
"merged_into": null,
|
||||
"pinned": false
|
||||
}
|
||||
]
|
||||
]
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"cadence": "weekly",
|
||||
"operation": "retrieve",
|
||||
"runId": "session-1771346034",
|
||||
"servicePath": "src/services/memory/index.js#getRelevantMemories",
|
||||
"inputs": {
|
||||
"agentId": "feature-proposer-agent",
|
||||
"promptPath": "src/prompts/weekly/feature-proposer-agent.md",
|
||||
"promptIntent": "Required startup + artifacts + memory + issue capture",
|
||||
"query": "scheduler | weekly | agent | feature-proposer-agent | intent | Required startup + artifacts + memory + issue capture",
|
||||
"events": 1
|
||||
},
|
||||
"outputs": {
|
||||
"ingestedCount": 1,
|
||||
"retrievedCount": 1
|
||||
},
|
||||
"status": "ok"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
MEMORY_RETRIEVED
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"cadence": "weekly",
|
||||
"operation": "store",
|
||||
"runId": "session-1771346112",
|
||||
"servicePath": "src/services/memory/index.js#ingestEvents",
|
||||
"inputs": {
|
||||
"agentId": "feature-proposer-agent",
|
||||
"promptPath": "src/prompts/weekly/feature-proposer-agent.md",
|
||||
"promptIntent": "Required startup + artifacts + memory + issue capture",
|
||||
"events": 1,
|
||||
"sourceFile": "memory-updates/2026-02-17T15-00-00Z__feature-proposer-agent.md"
|
||||
},
|
||||
"outputs": {
|
||||
"storedCount": 1,
|
||||
"summaries": [
|
||||
"# Memory Update - Feature Proposer Agent\n\n**Date**: 2026-02-17T15-00-00Z\n**Agent**: feature-proposer-agent\n\n## Insights\n- The `task-logs` structure is consistent and easy to parse.\n- A simple CLI tool (`features/log-summary.mjs`) was added to visualize this data.\n- This pattern …"
|
||||
]
|
||||
},
|
||||
"status": "ok"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
MEMORY_STORED
|
||||
@@ -0,0 +1,85 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* features/log-summary.mjs
|
||||
*
|
||||
* A utility script to parse task-logs and display a summary of recent agent runs.
|
||||
*
|
||||
* Usage:
|
||||
* node features/log-summary.mjs
|
||||
* node features/log-summary.mjs --cadence daily
|
||||
* node features/log-summary.mjs --limit 20
|
||||
*/
|
||||
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
|
||||
const CADENCES = ['daily', 'weekly'];
|
||||
const LOG_ROOT = 'task-logs';
|
||||
|
||||
function parseArgs() {
|
||||
const args = process.argv.slice(2);
|
||||
const limitIndex = args.indexOf('--limit');
|
||||
const limit = limitIndex !== -1 ? parseInt(args[limitIndex + 1], 10) : 10;
|
||||
|
||||
const cadenceIndex = args.indexOf('--cadence');
|
||||
const cadence = cadenceIndex !== -1 ? args[cadenceIndex + 1] : null;
|
||||
|
||||
return { limit, cadence };
|
||||
}
|
||||
|
||||
function getLogFiles(cadence) {
|
||||
const dir = path.join(LOG_ROOT, cadence);
|
||||
if (!fs.existsSync(dir)) return [];
|
||||
|
||||
return fs.readdirSync(dir)
|
||||
.filter(file => file.endsWith('.md') && !file.startsWith('_'))
|
||||
.map(file => {
|
||||
// Format: <timestamp>__<agent>__<status>.md
|
||||
// Example: 2026-02-17T14-29-07Z__dead-code-agent__completed.md
|
||||
const parts = file.replace('.md', '').split('__');
|
||||
if (parts.length < 3) return null;
|
||||
|
||||
return {
|
||||
timestamp: parts[0],
|
||||
agent: parts[1],
|
||||
status: parts[2],
|
||||
cadence,
|
||||
file
|
||||
};
|
||||
})
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
function main() {
|
||||
const { limit, cadence } = parseArgs();
|
||||
|
||||
let allLogs = [];
|
||||
|
||||
const cadencesToScan = cadence ? [cadence] : CADENCES;
|
||||
|
||||
for (const c of cadencesToScan) {
|
||||
allLogs = allLogs.concat(getLogFiles(c));
|
||||
}
|
||||
|
||||
// Sort by timestamp descending
|
||||
allLogs.sort((a, b) => b.timestamp.localeCompare(a.timestamp));
|
||||
|
||||
const displayedLogs = allLogs.slice(0, limit);
|
||||
|
||||
console.log(`\n🔍 Recent Agent Runs (Limit: ${limit})\n`);
|
||||
console.log(`| Timestamp | Cadence | Agent | Status |`);
|
||||
console.log(`|----------------------|---------|--------------------------------|-----------|`);
|
||||
|
||||
for (const log of displayedLogs) {
|
||||
const ts = log.timestamp.padEnd(20);
|
||||
const cad = log.cadence.padEnd(7);
|
||||
const agent = log.agent.padEnd(30);
|
||||
const status = log.status.padEnd(9);
|
||||
|
||||
console.log(`| ${ts} | ${cad} | ${agent} | ${status} |`);
|
||||
}
|
||||
console.log('');
|
||||
}
|
||||
|
||||
main();
|
||||
@@ -0,0 +1,16 @@
|
||||
# Memory Update - Feature Proposer Agent
|
||||
|
||||
**Date**: 2026-02-17T15-00-00Z
|
||||
**Agent**: feature-proposer-agent
|
||||
|
||||
## Insights
|
||||
- The `task-logs` structure is consistent and easy to parse.
|
||||
- A simple CLI tool (`features/log-summary.mjs`) was added to visualize this data.
|
||||
- This pattern of "small, standalone utility scripts" in `features/` is effective for incremental improvement.
|
||||
|
||||
## Actions
|
||||
- Implemented `features/log-summary.mjs`.
|
||||
- Verified with manual execution.
|
||||
|
||||
## Recommendations
|
||||
- Future agents could enhance this script to filter by status (e.g., show only failed runs).
|
||||
@@ -0,0 +1,30 @@
|
||||
# Context - Feature Proposer Agent Run
|
||||
|
||||
**Agent**: feature-proposer-agent
|
||||
**Cadence**: weekly
|
||||
**Run-Start**: 2026-02-17T15:00:00Z
|
||||
**Prompt-Path**: src/prompts/weekly/feature-proposer-agent.md
|
||||
|
||||
## Goal
|
||||
Implement a new feature to improve developer experience.
|
||||
|
||||
## Scope
|
||||
Create a new feature in `features/` directory.
|
||||
|
||||
## Constraints
|
||||
Single file, no new dependencies.
|
||||
|
||||
## Analysis
|
||||
- The repository has a `task-logs/` directory with daily and weekly logs.
|
||||
- Checking these logs manually is tedious.
|
||||
- A simple CLI tool to summarize these logs would be high-value and low-risk.
|
||||
- Prompt file: `src/prompts/weekly/feature-proposer-agent.md`.
|
||||
|
||||
## Selected Feature
|
||||
- `features/log-summary.mjs`: A Node.js script to parse and display a summary of recent agent runs.
|
||||
|
||||
## Implementation Details
|
||||
- Uses `fs` and `path` modules.
|
||||
- Scans `task-logs/daily` and `task-logs/weekly`.
|
||||
- Parses filenames `<timestamp>__<agent>__<status>.md`.
|
||||
- Outputs a formatted ASCII table.
|
||||
@@ -0,0 +1,24 @@
|
||||
# Decisions - Feature Proposer Agent Run
|
||||
|
||||
**Agent**: feature-proposer-agent
|
||||
**Cadence**: weekly
|
||||
**Run-Start**: 2026-02-17T15:00:00Z
|
||||
**Prompt-Path**: src/prompts/weekly/feature-proposer-agent.md
|
||||
|
||||
## Decision: Implement `features/log-summary.mjs`
|
||||
|
||||
### Context
|
||||
Developers and agents need a quick way to see the recent history of automated tasks without navigating the file system. Prompt: `src/prompts/weekly/feature-proposer-agent.md`.
|
||||
|
||||
### Options Considered
|
||||
1. **Dashboard Widget**: Requires frontend changes, more complex.
|
||||
2. **Lock Monitor**: Already covered by `lock:check`.
|
||||
3. **Log Summary CLI**: Simple, standalone, immediate value.
|
||||
|
||||
### Decision
|
||||
Chosen Option 3 (Log Summary CLI).
|
||||
|
||||
### Rationale
|
||||
- Fits the "single file" constraint perfectly.
|
||||
- No external dependencies required.
|
||||
- High utility for checking system health at a glance.
|
||||
@@ -0,0 +1,25 @@
|
||||
# Test Log - Feature Proposer Agent Run
|
||||
|
||||
**Agent**: feature-proposer-agent
|
||||
**Cadence**: weekly
|
||||
**Run-Start**: 2026-02-17T15:00:00Z
|
||||
**Prompt-Path**: src/prompts/weekly/feature-proposer-agent.md
|
||||
|
||||
## Verification Steps
|
||||
1. Run `node features/log-summary.mjs`.
|
||||
2. Check output for correctness.
|
||||
3. Verify against `src/prompts/weekly/feature-proposer-agent.md`.
|
||||
|
||||
## Execution
|
||||
- **Command**: `node features/log-summary.mjs`
|
||||
- **Result**: Pass. The script correctly identifies and lists recent log files.
|
||||
|
||||
## Output
|
||||
```
|
||||
🔍 Recent Agent Runs (Limit: 10)
|
||||
|
||||
| Timestamp | Cadence | Agent | Status |
|
||||
|----------------------|---------|--------------------------------|-----------|
|
||||
| 2026-02-17T14-29-07Z | weekly | dead-code-agent | completed |
|
||||
...
|
||||
```
|
||||
@@ -0,0 +1,17 @@
|
||||
# Todo - Feature Proposer Agent Run
|
||||
|
||||
**Agent**: feature-proposer-agent
|
||||
**Cadence**: weekly
|
||||
**Run-Start**: 2026-02-17T15:00:00Z
|
||||
**Prompt-Path**: src/prompts/weekly/feature-proposer-agent.md
|
||||
|
||||
## Completed
|
||||
- [x] Analyze repository for potential features.
|
||||
- [x] Select `log-summary.mjs` as the target feature.
|
||||
- [x] Create `features/` directory.
|
||||
- [x] Implement `features/log-summary.mjs`.
|
||||
- [x] Verify the script functionality.
|
||||
- [x] Follow instructions in `src/prompts/weekly/feature-proposer-agent.md`.
|
||||
|
||||
## Pending
|
||||
- [ ] Incorporate into main CLI (future work).
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
agent: feature-proposer-agent
|
||||
cadence: weekly
|
||||
date: 2026-02-17T15-00-00Z
|
||||
platform: linux
|
||||
status: completed
|
||||
---
|
||||
|
||||
# Feature Proposer Agent Run - Completed
|
||||
|
||||
**Date**: 2026-02-17T15:00-00Z
|
||||
**Agent**: feature-proposer-agent
|
||||
**Platform**: linux
|
||||
**Status**: completed
|
||||
|
||||
## Summary
|
||||
The agent successfully analyzed the repository and proposed a new feature: `features/log-summary.mjs`. This script provides a CLI summary of recent agent runs, improving developer visibility into system health.
|
||||
|
||||
## Artifacts
|
||||
- Feature: `features/log-summary.mjs`
|
||||
- Context: `src/context/CONTEXT_2026-02-17T15-00-00Z.md`
|
||||
- Todo: `src/todo/TODO_2026-02-17T15-00-00Z.md`
|
||||
- Decisions: `src/decisions/DECISIONS_2026-02-17T15-00-00Z.md`
|
||||
- Test Log: `src/test_logs/TEST_LOG_2026-02-17T15-00-00Z.md`
|
||||
- Memory: `memory-updates/2026-02-17T15-00-00Z__feature-proposer-agent.md`
|
||||
Reference in new issue
Block a user