feat: refactor work item file retrieval to use Python script for improved error handling and readability
This commit is contained in:
@@ -33,7 +33,7 @@ Behavior rules:
|
||||
- If missing context materially affects the answer, ask a concise clarification question instead of inventing details.
|
||||
- If the user corrects or teaches the agent during a learning session, update the smallest correct canonical file or behavior surface so future sessions benefit.
|
||||
- For any meaningful prompt, decide whether the interaction adds, corrects, or sharpens project memory.
|
||||
- When the user provides new durable information, update the right workspace files before or while answering.
|
||||
- When the user provides new durable information, update the right workspace files during the same turn when the destination is clear, but do not delay a straightforward answer just to create or reorganize memory.
|
||||
- When the user corrects how the workspace should behave, update the linked operational surface too: commands in `.opencode/commands/`, prompt templates in `prompts/`, agent rules in `AGENTS.md` or `.opencode/agents/`, skills in `.opencode/skills/`, and agent operating rules in `agent-memory/` when those files control the behavior.
|
||||
- If existing context is stale, correct it directly instead of leaving conflicting versions.
|
||||
- Promote information carefully:
|
||||
@@ -54,6 +54,8 @@ Behavior rules:
|
||||
- Write canonical memory to `project-knowledge/`.
|
||||
- Update preexisting memory when a new prompt clarifies or corrects something already stored.
|
||||
- Do not wait for a dedicated sync command if the correct memory update is already obvious.
|
||||
- For analysis, drafting, review, or translation prompts, answer first and persist second unless saving the fact is required to produce the answer safely.
|
||||
- Avoid creating brand-new canonical notes in the middle of a response unless the user explicitly asked for persistence or the new note is the smallest correct update.
|
||||
- Do not leave behavior-only corrections only in daily logs. If a correction should affect future output, update the tool or instruction that produces that output.
|
||||
- If the memory interface or Obsidian adapter fails, continue with direct Markdown operations when safe and do not promote the failure as project memory.
|
||||
- Do not over-promote uncertain information. Keep uncertain items in the daily log.
|
||||
|
||||
@@ -13,33 +13,21 @@ export const FidelityCompaction = async ({ directory }) => {
|
||||
return {
|
||||
"experimental.session.compacting": async (_input, output) => {
|
||||
const baseFiles = [
|
||||
"README.md",
|
||||
"core/README.md",
|
||||
"core/memory/operational-memory.md",
|
||||
"core/integrations/memory-vault-model.md",
|
||||
"core/integrations/communication-model.md",
|
||||
"profiles/fidelity/profile.md",
|
||||
"agent-memory/README.md",
|
||||
"agent-memory/behavior/agent-behavior.md",
|
||||
"agent-memory/behavior/learning-sessions.md",
|
||||
"agent-memory/memory/promotion-rules.md",
|
||||
"agent-memory/memory/context-maintenance.md",
|
||||
"agent-memory/integrations/technical-verification.md",
|
||||
"agent-memory/workflows/workspace-model.md",
|
||||
"agent-memory/workflows/ai-to-ai-prompting.md",
|
||||
"project-knowledge/00-start/start-here.md",
|
||||
"project-knowledge/01-current/current-work.md",
|
||||
"project-knowledge/01-current/work-items.md",
|
||||
"project-knowledge/03-context/project.md",
|
||||
"project-knowledge/03-context/ios/index.md",
|
||||
"project-knowledge/03-context/ios/current-practices.md",
|
||||
"project-knowledge/03-context/ios/project-swift-guidance.md",
|
||||
"project-knowledge/03-context/systems/index.md",
|
||||
"project-knowledge/03-context/workstreams/index.md",
|
||||
"project-knowledge/03-context/process/communication.md",
|
||||
"project-knowledge/03-context/ios/index.md",
|
||||
"project-knowledge/03-context/ios/project-swift-guidance.md",
|
||||
"project-knowledge/04-people/manager.md",
|
||||
"project-knowledge/04-people/index.md",
|
||||
"project-knowledge/05-decisions/rest-vs-graphql.md",
|
||||
"project-knowledge/05-decisions/discourse-handling.md",
|
||||
]
|
||||
|
||||
const sections = []
|
||||
@@ -56,7 +44,7 @@ export const FidelityCompaction = async ({ directory }) => {
|
||||
const logs = (await readdir(logsDir))
|
||||
.filter((name) => name.endsWith(".md"))
|
||||
.sort()
|
||||
.slice(-2)
|
||||
.slice(-1)
|
||||
|
||||
for (const logName of logs) {
|
||||
const content = await safeRead(path.join(logsDir, logName))
|
||||
|
||||
Reference in New Issue
Block a user