feat: refactor work item file retrieval to use Python script for improved error handling and readability

This commit is contained in:
2026-05-04 09:45:28 -06:00
parent 541c9b43de
commit ff4ed6a759
12 changed files with 195 additions and 143 deletions

View File

@@ -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))