portable-agent-layer 0.117.0-canary.9 → 0.117.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +5 -0
- package/README.md +7 -3
- package/assets/STATUSLINE.md +9 -8
- package/assets/agents/skill-author.md +2 -2
- package/assets/plugins/dark-factory/README.md +2 -2
- package/assets/plugins/dark-factory/scripts/build.mjs +100 -13
- package/assets/plugins/dark-factory/skills/build-with-agents/SKILL.md +1 -1
- package/assets/plugins/pal-status/.claude-plugin/plugin.json +6 -0
- package/assets/plugins/pal-status/hooks/hooks.json +1 -0
- package/assets/plugins/pal-status/hooks/register.tsx +58 -0
- package/assets/plugins/pal-status/types/index.d.ts +7 -0
- package/assets/schema/pal-settings.schema.json +2 -151
- package/assets/schema/settings.schema.json +155 -0
- package/assets/skills/analyze-pdf/tools/pdf-download.ts +3 -2
- package/assets/skills/consulting-report/.lintstagedrc.mjs +14 -0
- package/assets/skills/consulting-report/SKILL.md +1 -1
- package/assets/skills/consulting-report/demo/lib/report-data.ts +23 -74
- package/assets/skills/consulting-report/knip.json +4 -0
- package/assets/skills/consulting-report/template/app/page.tsx +8 -12
- package/assets/skills/consulting-report/template/bun.lock +93 -85
- package/assets/skills/consulting-report/template/components/comparison-table.tsx +1 -5
- package/assets/skills/consulting-report/template/components/stat-grid.tsx +2 -6
- package/assets/skills/consulting-report/template/lib/report-data.ts +13 -0
- package/assets/skills/consulting-report/template/lib/types.ts +14 -0
- package/assets/skills/consulting-report/template/package.json +13 -12
- package/assets/skills/consulting-report/template/tsconfig.json +1 -0
- package/assets/skills/consulting-report/tools/dev.ts +2 -4
- package/assets/skills/consulting-report/tools/generate-pdf.ts +15 -19
- package/assets/skills/consulting-report/tools/lib/copy-report.ts +25 -1
- package/assets/skills/consulting-report/tools/scaffold.ts +3 -14
- package/assets/skills/consulting-report/tsconfig.demo.json +9 -0
- package/assets/skills/create-pdf/tools/md-to-html-pdf.ts +4 -10
- package/assets/skills/create-skill/authoring-guide.md +12 -0
- package/assets/skills/minimum/README.md +16 -0
- package/assets/skills/minimum/SKILL.md +120 -0
- package/assets/skills/onboarding/SKILL.md +1 -1
- package/assets/skills/playwright/tools/shot.ts +11 -21
- package/assets/skills/presentation/tools/build.ts +14 -44
- package/assets/skills/presentation/tools/doctor.ts +2 -11
- package/assets/skills/presentation/tools/lib/inline.ts +0 -1
- package/assets/skills/presentation/tools/lib/lint-helpers.ts +4 -17
- package/assets/skills/presentation/tools/lib/lint-rules.ts +19 -62
- package/assets/skills/presentation/tools/lib/lint-types.ts +2 -8
- package/assets/skills/presentation/tools/lib/paths.ts +2 -4
- package/assets/skills/presentation/tools/new-deck.ts +5 -10
- package/assets/skills/presentation/tools/setup-template.ts +2 -8
- package/assets/skills/projects/SKILL.md +2 -2
- package/assets/skills/reflect/SKILL.md +2 -2
- package/assets/skills/rule-review/SKILL.md +3 -3
- package/assets/skills/telos/SKILL.md +1 -1
- package/assets/skills/telos/tools/update-telos.ts +3 -2
- package/assets/statusline.ps1 +105 -43
- package/assets/statusline.sh +84 -39
- package/assets/templates/PAL/AGENT_HOOKS.md +1 -1
- package/assets/templates/PAL/MEMORY_SYSTEM.md +20 -13
- package/assets/templates/PAL/README.md +13 -11
- package/assets/templates/PAL/SYSTEM_ARCHITECTURE.md +30 -11
- package/assets/templates/settings.claude.json +2 -1
- package/assets/templates/{pal-settings.json → settings.json} +1 -1
- package/package.json +21 -24
- package/src/{hooks/lib → bronze}/antigravity-transcript.ts +1 -1
- package/src/bronze/bronze.ts +368 -0
- package/src/{hooks/lib → bronze}/events.ts +76 -13
- package/src/bronze/import-log.ts +31 -0
- package/src/{hooks/lib → bronze}/ledger-hook.ts +5 -1
- package/src/{hooks/lib → bronze}/ledger.ts +7 -6
- package/src/{hooks/lib → bronze}/sensitive-path.ts +1 -1
- package/src/{hooks/lib → bronze}/signals.ts +15 -10
- package/src/bronze/tool-output.ts +18 -0
- package/src/bronze/transcript-lines.ts +104 -0
- package/src/bronze/transcript-preserve.ts +213 -0
- package/src/{hooks/lib → bronze}/transcript.ts +0 -5
- package/src/cli/algorithm-run.ts +128 -0
- package/src/cli/archive-layout.ts +27 -0
- package/src/cli/auth.ts +93 -0
- package/src/cli/compaction.ts +3 -3
- package/src/cli/content.ts +3 -3
- package/src/cli/correction.ts +3 -3
- package/src/cli/cost.ts +2 -2
- package/src/cli/doctor/agents.ts +2 -2
- package/src/cli/doctor/environment.ts +2 -2
- package/src/cli/doctor/finding.ts +2 -0
- package/src/cli/doctor/health.ts +100 -13
- package/src/cli/doctor/inference.ts +4 -4
- package/src/cli/doctor/render.ts +1 -1
- package/src/cli/doctor/run.ts +15 -1
- package/src/cli/doctor/state.ts +44 -16
- package/src/cli/doctor/summary.ts +38 -0
- package/src/cli/doctor/version-control.ts +1 -1
- package/src/cli/env.ts +2 -2
- package/src/cli/events.ts +7 -4
- package/src/cli/evidence.ts +1 -1
- package/src/cli/export-import.ts +274 -0
- package/src/cli/identity.ts +3 -3
- package/src/cli/index.ts +13 -310
- package/src/cli/infer.ts +2 -2
- package/src/cli/install-flow.ts +6 -6
- package/src/cli/judge.ts +3 -3
- package/src/cli/knowledge-add.ts +165 -0
- package/src/cli/knowledge-ingest.ts +70 -0
- package/src/cli/knowledge-research.ts +7 -7
- package/src/cli/knowledge-review.ts +117 -0
- package/src/cli/knowledge.ts +6 -352
- package/src/cli/ledger.ts +1 -1
- package/src/cli/leftovers.ts +75 -10
- package/src/cli/legacy-opinions.ts +94 -0
- package/src/cli/migrate.ts +184 -1134
- package/src/cli/migrations/data-backup.ts +137 -0
- package/src/cli/migrations/file-hash.ts +30 -0
- package/src/cli/migrations/late-write-sweep.ts +151 -0
- package/src/cli/migrations/layout-move.ts +110 -0
- package/src/cli/migrations/migration.ts +29 -0
- package/src/cli/migrations/move-guards.ts +168 -0
- package/src/cli/migrations/move-manifest.ts +119 -0
- package/src/cli/migrations/store-move.ts +40 -0
- package/src/cli/migrations/v1-projects.ts +62 -0
- package/src/cli/migrations/v10-threads-to-progress-tree.ts +88 -0
- package/src/cli/migrations/v11-memory-backups.ts +254 -0
- package/src/cli/migrations/v12-raw-to-records.ts +36 -0
- package/src/cli/migrations/v13-settings-to-root.ts +34 -0
- package/src/cli/migrations/v14-records-stores.ts +19 -0
- package/src/cli/migrations/v15-work-stores.ts +7 -0
- package/src/cli/migrations/v16-bronze-to-records.ts +7 -0
- package/src/cli/migrations/v2-threads-to-isc.ts +102 -0
- package/src/cli/migrations/v3-entities-to-knowledge.ts +196 -0
- package/src/cli/migrations/v4-paths-to-bindings.ts +70 -0
- package/src/cli/migrations/v5-attribution-keys.ts +102 -0
- package/src/cli/migrations/v6-history-slugs.ts +130 -0
- package/src/cli/migrations/v7-retired-settings-keys.ts +98 -0
- package/src/cli/migrations/v8-factory-home.ts +187 -0
- package/src/cli/migrations/v9-progress-tree-names.ts +108 -0
- package/src/cli/migrations/verified-move.ts +294 -0
- package/src/cli/patterns.ts +2 -2
- package/src/cli/personal-context.ts +4 -8
- package/src/cli/progress.ts +6 -6
- package/src/cli/rule.ts +70 -5
- package/src/cli/run-mode.ts +126 -7
- package/src/cli/schedule.ts +3 -3
- package/src/cli/server.ts +2 -2
- package/src/cli/session-agent.ts +2 -2
- package/src/cli/session-summary.ts +48 -0
- package/src/cli/setup-attribution.ts +3 -2
- package/src/cli/setup-auto-update.ts +1 -1
- package/src/cli/setup-identity.ts +3 -3
- package/src/cli/setup-telemetry.ts +1 -1
- package/src/cli/skill.ts +6 -5
- package/src/cli/telemetry.ts +1 -1
- package/src/cli/tree.ts +19 -3
- package/src/cli/ui/live.ts +4 -3
- package/src/cli/update-flow.ts +24 -3
- package/src/cli/whats-new.ts +1 -1
- package/src/cli/worktree.ts +1 -1
- package/src/cli/wrapped.ts +1 -1
- package/src/{hooks/lib → context}/claude-md.ts +5 -5
- package/src/{hooks/lib → context}/compact-recall.ts +1 -1
- package/src/{hooks/lib → context}/compaction-backtest.ts +2 -2
- package/src/{hooks/lib → context}/compaction-near.ts +12 -8
- package/src/context/context-overhead.ts +47 -0
- package/src/{hooks/lib → context}/context.ts +20 -8
- package/src/{hooks/lib → context}/daily-nudge.ts +8 -8
- package/src/{hooks/lib → context}/git-command-repo.ts +1 -1
- package/src/{hooks/lib → context}/post-git-info.ts +5 -5
- package/src/{hooks/lib → context}/repo-state.ts +50 -10
- package/src/{hooks/lib → context}/semi-static.ts +2 -2
- package/src/{hooks/lib → context}/session-context.ts +2 -2
- package/src/{hooks/lib → context}/skill-match.ts +3 -3
- package/src/context/start-refresh.ts +10 -0
- package/src/{hooks/lib → core}/agent.ts +5 -6
- package/src/{hooks/lib → core}/anchor.ts +22 -34
- package/src/{hooks/lib → core}/environment.ts +1 -1
- package/src/core/export-manifest.ts +42 -0
- package/src/{hooks/lib → core}/export.ts +14 -5
- package/src/core/hook-payload.ts +62 -0
- package/src/{hooks/lib → core}/import-merge.ts +29 -35
- package/src/{hooks/lib → core}/log.ts +0 -1
- package/src/core/machine-state.ts +21 -0
- package/src/{hooks/lib → core}/paths.ts +10 -11
- package/src/core/project-bindings.ts +72 -0
- package/src/{hooks/lib → core}/readme-sync.ts +36 -38
- package/src/{hooks/lib → core}/settings.ts +21 -5
- package/src/{hooks/lib → core}/spawn-guard.ts +1 -1
- package/src/hooks/AgentResponse.ts +4 -3
- package/src/hooks/AttentionEvent.ts +4 -4
- package/src/hooks/AutoUpdate.ts +2 -2
- package/src/hooks/CompactRecover.ts +8 -8
- package/src/hooks/HealthCheck.ts +16 -0
- package/src/hooks/InvocationContext.ts +4 -4
- package/src/hooks/LedgerSnapshot.ts +4 -4
- package/src/hooks/LoadContext.ts +17 -17
- package/src/hooks/PostGitInfo.ts +2 -2
- package/src/hooks/PostToolOrchestrator.ts +2 -2
- package/src/hooks/PreCompactPersist.ts +6 -6
- package/src/hooks/PreserveTranscripts.ts +4 -4
- package/src/hooks/PromptTransformed.ts +3 -3
- package/src/hooks/RtkWrap.ts +5 -5
- package/src/hooks/SecurityValidator.ts +7 -7
- package/src/hooks/SessionClose.ts +12 -6
- package/src/hooks/SkillGuard.ts +2 -2
- package/src/hooks/StopDeferred.ts +2 -2
- package/src/hooks/StopOrchestrator.ts +19 -19
- package/src/hooks/UserPromptOrchestrator.ts +9 -6
- package/src/hooks/handlers/agenda.ts +7 -7
- package/src/hooks/handlers/backup.ts +3 -3
- package/src/hooks/handlers/context-digests.ts +3 -3
- package/src/hooks/handlers/desktop-notify.ts +3 -3
- package/src/hooks/handlers/entity-extraction.ts +14 -10
- package/src/hooks/handlers/inject-retrieval.ts +17 -17
- package/src/hooks/handlers/persist-last-exchange.ts +7 -3
- package/src/hooks/handlers/project-touch.ts +6 -2
- package/src/hooks/handlers/rating.ts +20 -21
- package/src/hooks/handlers/readme-sync.ts +3 -3
- package/src/hooks/handlers/session-intelligence.ts +15 -15
- package/src/hooks/handlers/session-name.ts +4 -4
- package/src/hooks/handlers/synthesis.ts +2 -2
- package/src/hooks/handlers/update-check.ts +32 -7
- package/src/hooks/handlers/update-counts.ts +3 -3
- package/src/hooks/handlers/work-session.ts +8 -8
- package/src/hooks/lib/auto-update.ts +19 -6
- package/src/hooks/lib/collect-trigger.ts +23 -7
- package/src/hooks/lib/cursor-shadow.ts +2 -2
- package/src/hooks/lib/hook-turn.ts +6 -54
- package/src/hooks/lib/invocation-context.ts +7 -7
- package/src/hooks/lib/post-tool.ts +6 -6
- package/src/hooks/lib/prompt-capture.ts +1 -1
- package/src/hooks/lib/shadow-judgments.ts +3 -3
- package/src/hooks/lib/stdin.ts +1 -1
- package/src/hooks/lib/stop.ts +38 -30
- package/src/hooks/lib/telemetry.ts +9 -4
- package/src/inference/agent-login.ts +101 -0
- package/src/{hooks/lib → inference}/antigravity-inference.ts +2 -2
- package/src/{hooks/lib → inference}/detached-inference.ts +2 -2
- package/src/inference/inference-agents.ts +457 -0
- package/src/inference/inference-api.ts +143 -0
- package/src/inference/inference-binaries.ts +53 -0
- package/src/{hooks/lib → inference}/inference-events.ts +2 -2
- package/src/inference/inference-prompt.ts +70 -0
- package/src/inference/inference-spawn.ts +288 -0
- package/src/inference/inference-types.ts +33 -0
- package/src/{hooks/lib → inference}/inference-usage.ts +1 -11
- package/src/inference/inference.ts +371 -0
- package/src/{hooks/lib → inference}/judge-events.ts +1 -1
- package/src/{hooks/lib → inference}/judge-fallback.ts +1 -1
- package/src/{hooks/lib → inference}/judge.ts +3 -3
- package/src/inference/login-cache.ts +63 -0
- package/src/inference/login-rejected.ts +44 -0
- package/src/{hooks/lib → inference}/models.ts +1 -1
- package/src/{hooks/lib → inference}/opencode-config.ts +1 -1
- package/src/{hooks/lib → inference}/system-one-typesafe.ts +1 -1
- package/src/{hooks/lib → knowledge}/entity-cards.ts +2 -2
- package/src/{hooks/lib → knowledge}/entity-events.ts +1 -1
- package/src/{hooks/lib → knowledge}/entity-extraction.ts +6 -9
- package/src/{hooks/lib → knowledge}/entity-research.ts +3 -3
- package/src/{hooks/lib → knowledge}/entity-review.ts +1 -1
- package/src/{tools/knowledge → knowledge}/ingest.ts +5 -10
- package/src/{tools/knowledge → knowledge}/lib.ts +3 -73
- package/src/knowledge/yaml-scalars.ts +70 -0
- package/src/{hooks/lib → opinions}/adaptation-candidates.ts +2 -2
- package/src/{hooks/lib → opinions}/adaptation-rules.ts +3 -3
- package/src/{hooks/lib → opinions}/adaptation-steering.ts +6 -3
- package/src/{hooks/lib → opinions}/adaptation-turns.ts +8 -12
- package/src/{hooks/lib → opinions}/algorithm-review.ts +3 -2
- package/src/{hooks/lib → opinions}/analyze-nudge.ts +1 -1
- package/src/{hooks/lib → opinions}/claim-check.ts +3 -3
- package/src/{hooks/lib → opinions}/claim-log.ts +11 -10
- package/src/{hooks/lib → opinions}/correction-backfill.ts +1 -1
- package/src/{hooks/lib → opinions}/graduation.ts +6 -5
- package/src/{hooks/lib → opinions}/interaction-reaction.ts +1 -1
- package/src/{hooks/lib → opinions}/interaction-samples.ts +2 -2
- package/src/{hooks/lib → opinions}/interaction.ts +18 -9
- package/src/{hooks/lib → opinions}/learning-store.ts +2 -4
- package/src/{hooks/lib → opinions}/rating-judgments.ts +6 -6
- package/src/{hooks/lib → opinions}/reaction-audit.ts +1 -1
- package/src/{hooks/lib → opinions}/reply-checks.ts +2 -2
- package/src/{hooks/lib → opinions}/rule-effect.ts +2 -2
- package/src/{hooks/lib → opinions}/send-back-guard.ts +2 -3
- package/src/{hooks/lib → opinions}/steering.ts +4 -6
- package/src/{hooks/lib → opinions}/telos-goals.ts +1 -1
- package/src/{hooks/lib → opinions}/telos-topics.ts +1 -1
- package/src/{hooks/lib → opinions}/turn-extras.ts +1 -1
- package/src/{hooks/lib → progress}/agenda-store.ts +1 -1
- package/src/progress/algorithm-run-check-report.ts +121 -0
- package/src/progress/algorithm-run-checks.ts +198 -0
- package/src/progress/algorithm-run-facts.ts +67 -0
- package/src/progress/algorithm-run-replay.ts +204 -0
- package/src/progress/algorithm-run-report.ts +153 -0
- package/src/progress/algorithm-run-tools.ts +99 -0
- package/src/progress/algorithm-runs.ts +186 -0
- package/src/{hooks/lib → progress}/bindings.ts +7 -42
- package/src/{hooks/lib → progress}/capture-store.ts +1 -1
- package/src/{hooks/lib → progress}/commitment-events.ts +1 -1
- package/src/{hooks/lib → progress}/goal-links.ts +1 -1
- package/src/{hooks/lib → progress}/merged-worktrees.ts +1 -1
- package/src/{hooks/lib → progress}/parked-context.ts +3 -3
- package/src/{hooks/lib → progress}/parked-history.ts +11 -12
- package/src/progress/progress-artifact-match.ts +31 -0
- package/src/{hooks/lib → progress}/progress-session.ts +5 -1
- package/src/{hooks/lib → progress}/progress-tree-context.ts +2 -2
- package/src/{hooks/lib → progress}/progress-tree-git.ts +5 -3
- package/src/{hooks/lib → progress}/progress-tree-prs.ts +7 -3
- package/src/progress/progress-tree-stop.ts +25 -0
- package/src/{hooks/lib → progress}/progress-tree-tool.ts +6 -5
- package/src/progress/progress-tree-worktrees.ts +117 -0
- package/src/{hooks/lib → progress}/progress-tree.ts +3 -34
- package/src/progress/projects-context.ts +184 -0
- package/src/progress/projects-legacy.ts +51 -0
- package/src/{hooks/lib → progress}/projects.ts +43 -261
- package/src/{hooks/lib → progress}/scheduled-prompts.ts +5 -4
- package/src/{hooks/lib → progress}/session-names.ts +1 -1
- package/src/{hooks/lib → progress}/work-tracking.ts +11 -10
- package/src/safety/minimum-events.ts +50 -0
- package/src/safety/minimum-prompt.ts +136 -0
- package/src/{hooks/lib → safety}/run-estimates.ts +2 -2
- package/src/{hooks/lib → safety}/run-mode-gate.ts +88 -2
- package/src/{hooks/lib → safety}/run-mode.ts +55 -6
- package/src/{hooks/lib → safety}/security-gate.ts +15 -7
- package/src/{hooks/lib → safety}/security.ts +14 -2
- package/src/{hooks/lib → safety}/slurp-check.ts +7 -6
- package/src/{hooks/lib → safety}/slurp-detect.ts +1 -1
- package/src/targets/agent-render.ts +2 -5
- package/src/targets/antigravity/install.ts +3 -3
- package/src/targets/antigravity/uninstall.ts +2 -2
- package/src/targets/claude/agents.ts +1 -1
- package/src/targets/claude/attribution.ts +1 -1
- package/src/targets/claude/install.ts +2 -2
- package/src/targets/claude/uninstall.ts +1 -1
- package/src/targets/codex/install.ts +1 -1
- package/src/targets/codex/uninstall.ts +1 -1
- package/src/targets/copilot/install.ts +1 -1
- package/src/targets/copilot/uninstall.ts +1 -1
- package/src/targets/cursor/install.ts +1 -1
- package/src/targets/cursor/uninstall.ts +1 -1
- package/src/targets/opencode/install.ts +2 -2
- package/src/targets/opencode/permission.ts +1 -1
- package/src/targets/opencode/plugin.ts +37 -14
- package/src/targets/opencode/uninstall.ts +2 -2
- package/src/targets/pal-docs.ts +1 -3
- package/src/targets/personal-subagents.ts +2 -2
- package/src/targets/scaffold.ts +10 -11
- package/src/targets/shipped-agents.ts +2 -2
- package/src/targets/skill-index.ts +4 -7
- package/src/targets/skills.ts +13 -8
- package/src/targets/statusline.ts +2 -2
- package/src/targets/symlink.ts +1 -1
- package/src/tools/agent/algorithm-reflect.ts +7 -5
- package/src/tools/agent/algorithm-synthesize.ts +9 -7
- package/src/tools/agent/analyze.ts +2 -2
- package/src/tools/agent/interaction.ts +4 -4
- package/src/tools/agent/project-io.ts +42 -0
- package/src/tools/agent/project-isc-commands.ts +269 -0
- package/src/tools/agent/project-migrate.ts +56 -0
- package/src/tools/agent/project-task-isa.ts +62 -0
- package/src/tools/agent/project.ts +17 -425
- package/src/tools/agent/synthesize.ts +5 -49
- package/src/tools/control-room/attention.ts +3 -3
- package/src/tools/control-room/data.ts +8 -7
- package/src/tools/control-room/detail.ts +2 -2
- package/src/tools/control-room/matrix.ts +4 -8
- package/src/tools/control-room/prefs.ts +3 -7
- package/src/tools/control-room/relationship.ts +7 -11
- package/src/tools/control-room/server.ts +3 -3
- package/src/tools/control-room/snooze.ts +2 -2
- package/src/tools/control-room/static.ts +1 -1
- package/src/tools/control-room/ui/dist/assets/{index-cwDTgyVP.css → index-ClXFaob0.css} +1 -1
- package/src/tools/control-room/ui/dist/index.html +2 -2
- package/src/tools/control-room/ui/package.json +4 -4
- package/src/tools/control-room/ui/parts.tsx +1 -1
- package/src/tools/control-room/ui/screens/log.tsx +1 -1
- package/src/tools/control-room/ui/screens/relationship.tsx +2 -5
- package/src/tools/control-room/work.ts +2 -2
- package/src/tools/control-room/writes.ts +3 -7
- package/src/tools/dark-factory/stamp.ts +1 -1
- package/src/tools/knowledge/graph.ts +6 -5
- package/src/tools/ledger/query.ts +4 -4
- package/src/tools/ledger/view.ts +3 -3
- package/src/tools/lib/algorithm-reflect.ts +5 -2
- package/src/tools/lib/analyze-report.ts +1 -1
- package/src/tools/lib/backfill/entities.ts +2 -2
- package/src/tools/lib/backfill/git.ts +2 -2
- package/src/tools/lib/backfill/index.ts +3 -3
- package/src/tools/lib/backfill/ledger.ts +1 -5
- package/src/tools/lib/backfill/projects.ts +2 -2
- package/src/tools/lib/backfill/promises.ts +2 -2
- package/src/tools/lib/backfill/ratings.ts +1 -1
- package/src/tools/lib/backfill/rows.ts +1 -1
- package/src/tools/lib/backfill/sessions.ts +2 -2
- package/src/tools/lib/backfill/turns.ts +2 -6
- package/src/tools/lib/collectors/antigravity.ts +1 -1
- package/src/tools/lib/collectors/claude-denials.ts +240 -0
- package/src/tools/lib/collectors/claude.ts +93 -66
- package/src/tools/lib/collectors/codex.ts +2 -2
- package/src/tools/lib/collectors/copilot.ts +2 -2
- package/src/tools/lib/collectors/cursors.ts +1 -1
- package/src/tools/lib/collectors/index.ts +19 -11
- package/src/tools/lib/collectors/logged-keys.ts +61 -0
- package/src/tools/lib/collectors/opencode.ts +2 -2
- package/src/tools/lib/cost/efficiency.ts +1 -1
- package/src/tools/lib/cost/leaderboards.ts +1 -1
- package/src/tools/lib/cost/mix.ts +1 -1
- package/src/tools/lib/cost/overhead.ts +1 -1
- package/src/tools/lib/cost-report.ts +2 -2
- package/src/tools/lib/emit.ts +1 -1
- package/src/tools/lib/interaction-report.ts +5 -5
- package/src/tools/lib/patterns/activity.ts +1 -1
- package/src/tools/lib/patterns/profiles.ts +2 -2
- package/src/tools/lib/project-history.ts +3 -3
- package/src/tools/lib/project-resolver.ts +3 -7
- package/src/tools/lib/run-stats.ts +6 -6
- package/src/tools/lib/session-usage.ts +6 -2
- package/src/tools/lib/skill-doctor.ts +19 -144
- package/src/tools/lib/skill-parse.ts +134 -0
- package/src/tools/lib/thread.ts +2 -2
- package/src/tools/lib/usage-buckets.ts +7 -3
- package/src/tools/lib/wrapped/agents.ts +1 -1
- package/src/tools/lib/wrapped/habits.ts +2 -2
- package/src/tools/lib/wrapped/pal.ts +2 -2
- package/src/tools/lib/wrapped/records.ts +1 -1
- package/src/tools/lib/wrapped/render.ts +1 -1
- package/src/tools/lib/wrapped/totals.ts +1 -1
- package/src/tools/lib/wrapped/year.ts +2 -6
- package/src/tools/subagent-doctor.ts +15 -199
- package/src/tools/subagent-platform-checks.ts +195 -0
- package/src/tools/token-cost.ts +7 -7
- package/src/{hooks/lib → usage}/attention-events.ts +3 -3
- package/src/{tools/lib/collectors → usage}/billing.ts +1 -1
- package/src/usage/call-traits.ts +53 -0
- package/src/{hooks/lib → usage}/discord-events.ts +1 -1
- package/src/usage/health-cache.ts +105 -0
- package/src/{hooks/lib → usage}/hook-run.ts +1 -1
- package/src/{hooks/lib → usage}/hook-timing.ts +1 -1
- package/src/{hooks/lib → usage}/session-events.ts +3 -3
- package/src/{hooks/lib → usage}/tool-events.ts +42 -51
- package/src/{hooks/lib → usage}/waiting-on-user.ts +1 -1
- package/assets/skills/consulting-report/demo/app/globals.css +0 -459
- package/assets/skills/consulting-report/demo/app/layout.tsx +0 -32
- package/assets/skills/consulting-report/demo/app/page.tsx +0 -371
- package/assets/skills/consulting-report/demo/bun.lock +0 -243
- package/assets/skills/consulting-report/demo/components/callout.tsx +0 -13
- package/assets/skills/consulting-report/demo/components/comparison-table.tsx +0 -40
- package/assets/skills/consulting-report/demo/components/cover-page.tsx +0 -34
- package/assets/skills/consulting-report/demo/components/exhibit.tsx +0 -21
- package/assets/skills/consulting-report/demo/components/finding-card.tsx +0 -28
- package/assets/skills/consulting-report/demo/components/quote-block.tsx +0 -17
- package/assets/skills/consulting-report/demo/components/recommendation-card.tsx +0 -52
- package/assets/skills/consulting-report/demo/components/section.tsx +0 -17
- package/assets/skills/consulting-report/demo/components/severity-badge.tsx +0 -20
- package/assets/skills/consulting-report/demo/components/stat-grid.tsx +0 -26
- package/assets/skills/consulting-report/demo/components/table-of-contents.tsx +0 -27
- package/assets/skills/consulting-report/demo/components/timeline.tsx +0 -20
- package/assets/skills/consulting-report/demo/lib/utils.ts +0 -6
- package/assets/skills/consulting-report/demo/next.config.js +0 -9
- package/assets/skills/consulting-report/demo/package.json +0 -27
- package/assets/skills/consulting-report/demo/postcss.config.mjs +0 -5
- package/assets/skills/consulting-report/demo/tsconfig.json +0 -41
- package/src/hooks/lib/context-overhead.ts +0 -30
- package/src/hooks/lib/export-manifest.ts +0 -23
- package/src/hooks/lib/inference.ts +0 -1379
- package/src/hooks/lib/progress-tree-stop.ts +0 -14
- package/src/hooks/lib/progress-tree-worktrees.ts +0 -80
- package/src/hooks/lib/transcript-preserve.ts +0 -145
- /package/src/{hooks/lib → bronze}/channel.ts +0 -0
- /package/src/{hooks/lib → bronze}/evidence.ts +0 -0
- /package/src/{hooks/lib → context}/skill-triggers.ts +0 -0
- /package/src/{hooks/lib → core}/actor.ts +0 -0
- /package/src/{hooks/lib → core}/agent-definition.ts +0 -0
- /package/src/{hooks/lib → core}/agent-registry.ts +0 -0
- /package/src/{hooks/lib → core}/frontmatter.ts +0 -0
- /package/src/{hooks/lib → core}/identity-store.ts +0 -0
- /package/src/{hooks/lib → core}/machine.ts +0 -0
- /package/src/{hooks/lib → core}/notify.ts +0 -0
- /package/src/{hooks/lib → core}/pal-env.ts +0 -0
- /package/src/{hooks/lib → core}/prompt-text.ts +0 -0
- /package/src/{hooks/lib → core}/remote.ts +0 -0
- /package/src/{hooks/lib → core}/session-dir.ts +0 -0
- /package/src/{hooks/lib → core}/text-similarity.ts +0 -0
- /package/src/{hooks/lib → core}/time.ts +0 -0
- /package/src/{hooks/lib → core}/wall-clock.ts +0 -0
- /package/src/{hooks/lib → core}/which.ts +0 -0
- /package/src/{hooks/lib → inference}/judgment.ts +0 -0
- /package/src/{tools/lib → inference}/transcript-usage.ts +0 -0
- /package/src/{hooks/lib → knowledge}/company-register-router.ts +0 -0
- /package/src/{hooks/lib → knowledge}/company-register.ts +0 -0
- /package/src/{hooks/lib → knowledge}/entity-names.ts +0 -0
- /package/src/{hooks/lib → knowledge}/hungarian-registry.ts +0 -0
- /package/src/{hooks/lib → opinions}/correction-kind.ts +0 -0
- /package/src/{hooks/lib → opinions}/correction-rates.ts +0 -0
- /package/src/{hooks/lib → opinions}/interaction-hint-check.ts +0 -0
- /package/src/{hooks/lib → opinions}/interaction-mood.ts +0 -0
- /package/src/{hooks/lib → opinions}/interaction-preferences.ts +0 -0
- /package/src/{hooks/lib → opinions}/opinion-gate.ts +0 -0
- /package/src/{hooks/lib → opinions}/reaction-rating.ts +0 -0
- /package/src/{hooks/lib → opinions}/rule-drafter.ts +0 -0
- /package/src/{hooks/lib → opinions}/rule-proof.ts +0 -0
- /package/src/{hooks/lib → progress}/progress-tree-factory.ts +0 -0
- /package/src/{hooks/lib → progress}/progress-tree-render.ts +0 -0
- /package/src/{hooks/lib → progress}/progress-tree-session-end.ts +0 -0
- /package/src/{hooks/lib → progress}/progress-tree-session-node.ts +0 -0
- /package/src/{hooks/lib → progress}/progress-tree-tidy.ts +0 -0
- /package/src/{hooks/lib → progress}/serves.ts +0 -0
- /package/src/{hooks/lib → safety}/rtk-jq.ts +0 -0
- /package/src/{hooks/lib → safety}/rtk-worktree.ts +0 -0
- /package/src/tools/control-room/ui/dist/assets/{index-CaPwwSsD.js → index-DtUW62FY.js} +0 -0
- /package/src/{hooks/lib → usage}/opencode-events.ts +0 -0
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"name": "dark-factory",
|
|
11
11
|
"source": "./assets/plugins/dark-factory",
|
|
12
12
|
"description": "A software factory of agents that turns a request into a green, reviewed pull request."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "pal-status",
|
|
16
|
+
"source": "./assets/plugins/pal-status",
|
|
17
|
+
"description": "PAL's status above the prompt. Today it holds PAL's standing notice, such as data moves required before 1.0, until it is fixed."
|
|
13
18
|
}
|
|
14
19
|
]
|
|
15
20
|
}
|
package/README.md
CHANGED
|
@@ -83,7 +83,7 @@ pal cli status # check your setup
|
|
|
83
83
|
| `pal cli init` | Scaffold PAL home directory and install hooks |
|
|
84
84
|
| `pal cli install` | Register hooks/skills for targets |
|
|
85
85
|
| `pal cli uninstall` | Remove hooks/skills for targets |
|
|
86
|
-
| `pal cli update` | Update PAL (git pull or npm update) and reinstall hooks. Install asks once whether to do this on its own: when a session closes PAL checks for a release (at most hourly) and installs it, so opening PAL is never slowed. A failed update waits a day before retrying. The switch lives in the control room under Settings → Updates. On a repo install an update waits while the clone has uncommitted changes. `--canary` switches a package install to the `canary` prerelease channel; from then on plain `pal cli update`, auto-update and the update notice follow canary until `--stable` switches back. Neither ever installs an older version than the one you have |
|
|
86
|
+
| `pal cli update` | Update PAL (git pull or npm update) and reinstall hooks. Install asks once whether to do this on its own: when a session closes PAL checks for a release (at most hourly) and installs it, so opening PAL is never slowed. A failed update waits a day before retrying. The switch lives in the control room under Settings → Updates. On a repo install an update waits while the clone has uncommitted changes. `--canary` switches a package install to the `canary` prerelease channel; from then on plain `pal cli update`, auto-update and the update notice follow canary until `--stable` switches back. Neither ever installs an older version than the one you have. Updates stay within the installed major version: a new major is installed only by `pal cli update --major`, and the update notice and statusline say so |
|
|
87
87
|
| `pal cli export` | Export user state (telos, memory) to a zip |
|
|
88
88
|
| `pal cli import` | Import user state from a zip |
|
|
89
89
|
| `pal cli status` | Show current PAL configuration |
|
|
@@ -94,16 +94,18 @@ pal cli status # check your setup
|
|
|
94
94
|
| `pal cli cost` | What each month was paid against its API-equivalent cost, per agent |
|
|
95
95
|
| `pal cli wrapped [--year <yyyy>]` | A year of your work in numbers, read from the event log |
|
|
96
96
|
| `pal cli env [--refresh]` | The OS and script languages PAL tells every agent about; `--refresh` detects again after you install one |
|
|
97
|
+
| `pal cli auth [--refresh] [--json]` | When the active agent's login expires (Claude only; other agents do not report it). Reads the answer cached at session start; `--refresh` asks the agent again |
|
|
97
98
|
| `pal cli patterns` | How you work across projects, read from the event log |
|
|
98
99
|
| `pal cli progress [show\|list\|open\|enter\|park\|wait\|done\|stopped\|decide\|attach\|follow-up]` | The progress tree: what you are on in this project, where it stopped, what is parked or waiting, and the decisions and artifacts on each node. Detours are child nodes and `done` returns to the parent. The active node rides along in every session and prompt, and your own commits attach to it at turn end |
|
|
99
100
|
| `pal cli timebox [start\|status\|end]` | Stop work at a deadline: `start --for 15m` or `--until 18:00`. After the deadline every working tool call is refused except `pal cli` and edits to the report, so the agent stops and reports what it has |
|
|
100
101
|
| `pal cli schedule [add\|list\|remove]` | Prompts added at a time of day, for you or for one project: `add --from 20:00 "suggest tasks that can run overnight"`. A due schedule is added to the next prompt you write inside its window, once a day by default (`--every-session`, `--every-prompt`), and nothing fires while no session is open |
|
|
102
|
+
| `pal cli minimum [start\|round\|status\|end]` | Keep working at least until a floor: `start --for 30m --goal … --bar "clarity: 9/10, reread against the brief"`. Before the floor a stop is sent back with the goal, the bar, the last round's weakest point and a rotating lens (fresh-context critic, skeptic, simplify, …); questions and the agent's own `end` are refused, so only you end it early |
|
|
101
103
|
| `pal cli unattended [start\|log\|status\|done\|end]` | Work without you until a deadline: `start --until 05:30 --task … --fallback …`. Questions and subagents are refused, the agent cannot stop while approved tasks are left, and the rules, tasks and log come back after a compaction |
|
|
102
|
-
| `pal cli content preserve` | Copy every Claude Code transcript, gzipped, into `
|
|
104
|
+
| `pal cli content preserve` | Copy every Claude Code transcript, gzipped, into `records/raw/claude/` before Claude Code deletes it (30 days by default). Runs on its own whenever a session closes; the content store never leaves the machine, so `export` skips it |
|
|
103
105
|
| `pal cli events discord-nag <sent\|answered>` | For a bot outside PAL: record a nag it sent (`--kind <kind>`), or the answer to one and how long it took (`--after-sec <n>`), in the local event log |
|
|
104
106
|
| `pal cli evidence [turns\|show\|forget\|unforget\|forgotten]` | What PAL learns from: `turns` lists the turns you typed (`--days <n>`, `--json`) with their text and the reply each got, and `show <id>` prints one event's stored text. `forget <id>` keeps a turn or reply out of everything PAL learns without deleting its text; `forgotten` lists every forgotten event and `unforget <id>` undoes one. Every forget and unforget stays in the event log |
|
|
105
107
|
| `pal cli infer` | One model call for scripts and bots, on the active agent's route: prompt on stdin, reply on stdout. `--tier small\|medium\|large\|flagship` (on Claude: Haiku, Sonnet, Opus, Fable; on Codex: Luna, Sol, Sol at high effort, Astra; on Antigravity: Flash at low, medium and high effort, and no flagship; an agent without the tier asked refuses it), `--system <file>`, `--schema <file>` for a JSON reply checked against it, `--timeout <seconds>`. The call loads no PAL hooks or context; exits 1 with the reason when no route answers |
|
|
106
|
-
| `pal cli judge [file]` | Answer typed questions (`choice`, `noul`, `score`) about a state, from a JSON request in the file or on stdin; prints the answers and the route as JSON. With `systemOne` in
|
|
108
|
+
| `pal cli judge [file]` | Answer typed questions (`choice`, `noul`, `score`) about a state, from a JSON request in the file or on stdin; prints the answers and the route as JSON. With `systemOne` in `~/.pal/settings.json` (`provider: "typesafe"`, optional `model`, default `jev-1.14.0`, and `callers` set to `shadow` or `live`), the named callers also ask that provider, which sends their text to it; the key is `PAL_TYPESAFE_API_KEY`, else `TYPESAFE_API_KEY`. Without it, or when the provider fails, the small tier answers |
|
|
107
109
|
| `pal cli actor [label <name>]` | Show or rename the actor — who caused a record. Travels with an export, so a shared memory can tell two people apart |
|
|
108
110
|
| `pal cli machine [label <name>]` | Show or rename this install — where a record was written. Never leaves the machine |
|
|
109
111
|
| `pal cli telos` | Which TELOS topics are answered, in interview order, and which one comes next |
|
|
@@ -113,6 +115,7 @@ pal cli status # check your setup
|
|
|
113
115
|
| `pal cli rule` | Review the rules drafted from your corrections — `list [--all] [--json]`, `approve <id>`, `opinion <id>`, `deny <id>`, `retire <id>`, `add-opinion --kind --when --steering`. A draft steers nothing until approved; a denied one is never drafted again. An opinion has no trigger and steers every session, at most 8 of them and one per correction kind; `list --all` shows each one's correction-kind rate before and after approval |
|
|
114
116
|
| `pal cli correction` | The kinds of mistakes you corrected — `kinds [--days N] [--split DATE] [--json]` shows each kind per 100 turns, before and after a date with `--split`; `backfill` labels confirmed corrections without a kind or with one from an older prompt, and `--relabel` labels every one again |
|
|
115
117
|
| `pal cli compaction backtest` | Score the shadow "compaction is close" rule against logged history. Labels each auto compaction `threshold`, `idle`, `no_context` or `unexplained`, and per margin reports the threshold compactions it warned and missed, its false alarms, and the median lead in minutes and tokens. `--margin <fraction>[,...]` (default 0.2), `--days <n>` (default 30), `--window <tokens>[@<until>]` (repeatable), `--json` |
|
|
118
|
+
| `pal cli algorithm-run report` | Shadow numbers for ALGORITHM runs, recorded per progress-tree node: turns and runs started, how runs ended (finished, superseded, open), verdicts with the share of `no-node`, turns without a reflection by the last phase reached, and every `over-open-run` case to label; then the run checks: run types (code, research, explain), exemptions, would-nudge verdicts per check (`no-reflection`, `no-check-after-edit`, `uncited-fetch`), the verdicts on exempt turns by exemption reason, and one line per case to label. Records only; warns and blocks nothing. `--since <date>`, `--json` |
|
|
116
119
|
| `pal cli server` | The morning screen: a local page to open before a terminal — three moves for today, an urgent/important grid over every project *and* every stated goal, where you left off, and a drawer holding the signal and the action ledger — `start [--port <n>]`, `stop`, `status`. Loopback only, default port 7250. No model runs on page load |
|
|
117
120
|
| `pal cli skill link <name>` | Link a personal `~/.pal/skills/<name>/` into every installed agent so it is discoverable |
|
|
118
121
|
| `pal cli skill doctor <name>` | Evaluate a skill against the authoring best practices (folder/file-name match, name, description, body length, point-of-view, reference depth) |
|
|
@@ -198,6 +201,7 @@ pal cli debug # show current status and log path
|
|
|
198
201
|
| `PAL_INFERENCE_DISABLED` | Set to `1` to disable all inference (used by the test suite to prevent real CLI spawns) |
|
|
199
202
|
| `PAL_NOTIFICATIONS_DISABLED` | Set to `1` to suppress desktop notifications (used by the test suite) |
|
|
200
203
|
| `PAL_TEST_SANDBOX` | Set by the test suite. Without a `PAL_HOME`, state goes to a temp directory instead of `~/.pal`, and installers refuse to touch real agent directories |
|
|
204
|
+
| `PAL_TEST_ROOT` | Set by the test suite: the folder test homes live in. Each mutation-testing worker gets its own, so parallel workers never share a test home |
|
|
201
205
|
|
|
202
206
|
### Telemetry
|
|
203
207
|
|
package/assets/STATUSLINE.md
CHANGED
|
@@ -4,19 +4,21 @@ A customizable status line for Claude Code that displays context usage, active m
|
|
|
4
4
|
|
|
5
5
|
## What It Shows
|
|
6
6
|
|
|
7
|
-
**Line 1:** Model name, current directory, git branch,
|
|
7
|
+
**Line 1:** Model name, current directory, git branch, open ISCs
|
|
8
8
|
**Line 2:** Context usage progress bar, percentage used, session cost, remaining context, rate limits
|
|
9
|
-
**Line 3:** Update notice (only when a new PAL version is available)
|
|
9
|
+
**Line 3:** Update notice (only when a new PAL version is available)
|
|
10
|
+
**Run line:** The timebox, unattended or minimum run of this folder or project: its deadline (or floor) in your PAL timezone, time left and, for a minimum run, rounds logged (only while one is on)
|
|
11
|
+
**Health line:** The worst failing check in red, or the warning count in yellow, pointing to `pal cli doctor` (only when something needs attention)
|
|
10
12
|
|
|
11
13
|
Example output (macOS/Linux):
|
|
12
14
|
```
|
|
13
|
-
[Opus] 📁 portable-agent-layer 🌿 main 📋 21 open ISCs
|
|
15
|
+
[Opus] 📁 portable-agent-layer 🌿 main 📋 21 open ISCs
|
|
14
16
|
████████░░░░░░░░░░░░ 45% │ $0.12 │ 55% free
|
|
15
17
|
```
|
|
16
18
|
|
|
17
19
|
Example output (Windows):
|
|
18
20
|
```
|
|
19
|
-
[Opus] folder: portable-agent-layer (git: main) 21 open ISCs
|
|
21
|
+
[Opus] folder: portable-agent-layer (git: main) 21 open ISCs
|
|
20
22
|
########------------ 45% - $0.12 - 55% free
|
|
21
23
|
```
|
|
22
24
|
|
|
@@ -67,7 +69,7 @@ chmod +x ~/.cursor/statusline.sh
|
|
|
67
69
|
|
|
68
70
|
Copy `assets/statusline.sh` to `~/.cursor/statusline.sh` (or symlink). Restart the Cursor CLI after editing config.
|
|
69
71
|
|
|
70
|
-
On Cursor, session cost and rate limits are usually absent from stdin — the script omits the cost segment and hides rate limits automatically. PAL indicators (hooks, ISCs,
|
|
72
|
+
On Cursor, session cost and rate limits are usually absent from stdin — the script omits the cost segment and hides rate limits automatically. PAL indicators (hooks, ISCs, update) still read from `~/.pal/memory/state/`.
|
|
71
73
|
|
|
72
74
|
### On Windows
|
|
73
75
|
|
|
@@ -95,15 +97,14 @@ The statusline script is at: `portable-agent-layer/assets/statusline.ps1`
|
|
|
95
97
|
- **Model:** Active Claude model (Opus, Sonnet, Haiku, etc.)
|
|
96
98
|
- **Directory:** Repository name (if in a git repo) or folder name
|
|
97
99
|
- **Git Branch:** Current branch, fetched from git worktree or `git` command
|
|
98
|
-
- **Hook Health:** Count of ERROR lines in `~/.pal/memory/state/debug.log` from last 24h (hidden when 0)
|
|
99
100
|
- **Open ISCs:** Count of unchecked ISCs for the current project (hidden when 0)
|
|
100
|
-
- **Signal Trend:** Session quality score from `~/.pal/memory/state/signal-cache.json` with trend arrow
|
|
101
101
|
- **Context Bar:** Visual progress bar showing token usage
|
|
102
102
|
- **Context %:** Percentage of context window used
|
|
103
103
|
- **Cost:** Estimated session cost in USD (shows "free" if <$0.01 on macOS/Linux, `$0.00` on Windows)
|
|
104
104
|
- **Remaining %:** Percentage of context window remaining
|
|
105
105
|
- **Rate Limits:** 5h and 7d usage percentages (Pro/Max plans only — hidden on other plans)
|
|
106
|
-
- **Update Notice:** Shown on line 3 when `~/.pal/
|
|
106
|
+
- **Update Notice:** Shown on line 3 when `~/.pal/cache/update-available.json` flags a new version
|
|
107
|
+
- **Health:** Read from `~/.pal/cache/health.json`, which every doctor run writes (PAL starts one in the background at session start when it is missing or over 6 hours old), and `~/.pal/cache/login-rejected.json`, which a rejected background Claude call writes at once. Shows `Claude token rejected` or `Claude login rejected` first, else the worst failing check (with `(+N more)` when several fail), else `N warnings`; hidden when all is fine. Run `pal cli doctor` for the details and fixes
|
|
107
108
|
|
|
108
109
|
## Dependencies
|
|
109
110
|
|
|
@@ -43,7 +43,7 @@ You author a single new personal skill for this user. You are handed a **skill n
|
|
|
43
43
|
|
|
44
44
|
1. Read `~/.pal/skills/create-skill/authoring-guide.md` with your file-reading tool — it is the single source of truth for what a good skill is and the exact anatomy to follow.
|
|
45
45
|
2. Validate the name: lowercase-kebab, no spaces, not colliding with an existing skill (check `~/.pal/skills/` and the active skill list). If it collides or is malformed, stop and report the conflict instead of overwriting.
|
|
46
|
-
3. Create the skill and write its `SKILL.md` to `~/.pal/skills/<name>/SKILL.md`, creating the folder if it does not exist, populated per the guide's anatomy (frontmatter + Workflow + Output format + When to use).
|
|
46
|
+
3. Create the skill and write its `SKILL.md` to `~/.pal/skills/<name>/SKILL.md`, creating the folder if it does not exist, populated per the guide's anatomy (frontmatter + Workflow + Output format + When to use + Self-check).
|
|
47
47
|
4. If the skill needs runtime tooling, scaffold a `tools/` subdir alongside `SKILL.md` and write the scripts there.
|
|
48
48
|
5. Link the skill into every installed agent:
|
|
49
49
|
```bash
|
|
@@ -54,7 +54,7 @@ You author a single new personal skill for this user. You are handed a **skill n
|
|
|
54
54
|
pal cli skill doctor <name>
|
|
55
55
|
```
|
|
56
56
|
A name/folder mismatch or a misnamed file makes the skill silently fail to load — never skip this.
|
|
57
|
-
7. Hand-check what the doctor can't: trigger clarity, step concreteness (every step has a verb and an object), output specification,
|
|
57
|
+
7. Hand-check what the doctor can't: trigger clarity, step concreteness (every step has a verb and an object), output specification, scope discipline (one skill, one job), and the Self-check section naming this skill's folder.
|
|
58
58
|
|
|
59
59
|
## Output
|
|
60
60
|
|
|
@@ -115,11 +115,11 @@ Each repository the factory works on has a `.dark-factory.json` at its root:
|
|
|
115
115
|
}
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
-
The build keeps the code step from editing a test. Right before the code step it fingerprints the worktree, and every test file in it is protected; after the code step a protected file that changed or was deleted is listed in a `test_edits_restored` event and restored by the fix ladder, and a second change stops the task stuck. A file is a test file when its path starts with an entry of `testPaths`, for example `"testPaths": ["spec/"]`. Without `testPaths`, a file is a test file when its name contains `.test.` or `.spec.`, or a directory in its path is named `test`, `tests` or `__tests__`. New test files are allowed.
|
|
118
|
+
The build keeps the code step from editing a test. Right before the code step it fingerprints the worktree, and every test file in it is protected; after the code step a protected file that changed or was deleted is listed in a `test_edits_restored` event and restored by the fix ladder, and a second change stops the task stuck. A file is a test file when its path starts with an entry of `testPaths`, for example `"testPaths": ["spec/"]`. Without `testPaths`, a file is a test file when its name contains `.test.` or `.spec.`, or a directory in its path is named `test`, `tests` or `__tests__`. New test files are allowed. Before a restore, the build asks the PO, with each file's diff: a file the PO names in `testFix` keeps its change, logged as `test_edits_kept`, and is protected from then on in its new content. The ruling counts toward the run's 2 test fixes; once they are spent, edits are restored without asking. `step.mjs test-edits` still only lists the files.
|
|
119
119
|
|
|
120
120
|
A spec can name the test files the task is meant to change in a section headed exactly `## Test files this task changes`, with one repo-relative path per `- ` bullet, backticks optional. The guard leaves those files out: they are not restored, not listed, and a second change does not stop the build. Only `spec.md` grants this, and the same section in `plan.md`, `tests.md`, `repro.md` or `design.md` exempts nothing. The list is read each time the guard runs, so a spec changed during the build counts. The review, tester and CI fix ladders are guarded like the code step: each fingerprints the worktree before its first rung, and once it passes the gate a protected test file it changed is restored the same way.
|
|
121
121
|
|
|
122
|
-
The categories with a test writer (`bug`, `feature` and `big-feature`) need a gate check named exactly `tests`. The build runs it right after the test writer, and the task is stuck when no test fails. Before that check, the build runs the gate for the role `test-writer`; when it fails, the test writer runs again with the failed checks, at most 2 more times, and then the task is stuck.
|
|
122
|
+
The categories with a test writer (`bug`, `feature` and `big-feature`) need a gate check named exactly `tests`. The build runs it right after the test writer, and the task is stuck when no test fails. Before that check, the build runs the gate for the role `test-writer`; when it fails, the test writer runs again with the failed checks, at most 2 more times, and then the task is stuck. The unit tests typed from plan.md may add the code the plan defines as stubs that only fail when they run (`todo!()` in Rust), so that in a compiled language they compile and fail with a count. When they do not compile, the build sends the test writer back once with the first compile error; a second failure is stuck with `the tests do not compile: <first error>`. A stub left in place fails the gate, because the test that names it still runs it.
|
|
123
123
|
|
|
124
124
|
The `tests` check must run every test file even when one fails, because the build counts failures to prove the new tests fail. Give `cargo test` the `--no-fail-fast` flag, and do not join two suites with `&&`, which skips the second when the first fails. Run both and keep the first one's failure, for example `cargo test --no-fail-fast; status=$?; bun run test && exit $status`. The build adds up every per-test summary it finds: cargo's `test result:` line for each test binary, bun's ` N fail`, and jest's or vitest's `Tests` line. Per-file lines (`Test Suites`, `Test Files`) are not counted. When the output has none of these lines, the last `N fail` or `N failed` in it is the count.
|
|
125
125
|
|
|
@@ -82,8 +82,9 @@ const ACCEPTANCE_TESTS_INSTRUCTIONS =
|
|
|
82
82
|
"Write the failing acceptance tests from spec.md only; there is no plan yet, so do not read plan.md. Write tests.md in the task folder mapping each test to the acceptance criteria it covers. Leave the tests uncommitted; the code writer commits them with the code.";
|
|
83
83
|
const PLAN_AFTER_TESTS_INSTRUCTIONS =
|
|
84
84
|
"Write plan.md for this change. Failing acceptance tests already exist in the worktree (see tests.md in the task folder); the plan must make them pass without changing them.";
|
|
85
|
-
const
|
|
86
|
-
"
|
|
85
|
+
const STUB_RULE =
|
|
86
|
+
"When a test names a function, type or method that plan.md defines and that does not exist yet, add it where plan.md puts it, with the plan's signature and a body that only fails when it runs (todo!() in Rust, panic in Go, a thrown error elsewhere), so the tests compile and fail; the code writer replaces it.";
|
|
87
|
+
const UNIT_TESTS_INSTRUCTIONS = `Type one unit test per row of each example table in plan.md, in the test files the plan names. Test only what the tables state, change no other file except for those stubs, and leave everything uncommitted. ${STUB_RULE} When plan.md has no example tables, change nothing.`;
|
|
87
88
|
const SETTLE_PLAN_INSTRUCTIONS =
|
|
88
89
|
"The plan gate ended with findings it could not settle, and their answers are now in the spec's Decisions. Read spec.md again and apply its Decisions to plan.md.";
|
|
89
90
|
const REPLAN_INSTRUCTIONS =
|
|
@@ -105,7 +106,10 @@ export const FINGERPRINT_UNREADABLE =
|
|
|
105
106
|
const TEST_FIX_DIFF_UNREADABLE =
|
|
106
107
|
"could not list the files the test fix changed: git diff --name-only failed";
|
|
107
108
|
const TEST_EDITS_EVENT = "test_edits_restored";
|
|
109
|
+
const TEST_EDITS_KEPT_EVENT = "test_edits_kept";
|
|
110
|
+
const TEST_EDIT_DIFF_LIMIT = 4000;
|
|
108
111
|
const UNIT_TESTS_NO_RISE_EVENT = "unit_tests_no_rise";
|
|
112
|
+
const UNIT_TESTS_NO_COMPILE_EVENT = "unit_tests_do_not_compile";
|
|
109
113
|
|
|
110
114
|
function stuck(message) {
|
|
111
115
|
return { status: "stuck", message };
|
|
@@ -247,6 +251,13 @@ ${changed}
|
|
|
247
251
|
Move the tests you added into a new test file that no other test uses, keep the tests themselves as they are, leave them uncommitted, and change no other file.`;
|
|
248
252
|
}
|
|
249
253
|
|
|
254
|
+
function noCompileRetryInstructions(error) {
|
|
255
|
+
return `Your unit tests do not compile, so the test run reports no failing test count. The first error:
|
|
256
|
+
${error}
|
|
257
|
+
|
|
258
|
+
${STUB_RULE} Keep the tests as they are, leave everything uncommitted, and change no other file.`;
|
|
259
|
+
}
|
|
260
|
+
|
|
250
261
|
function unchangedNamedMessage(named, outside) {
|
|
251
262
|
const base = `the test the PO ruled wrong was not changed: the test writer changed none of ${named.join(", ")}`;
|
|
252
263
|
|
|
@@ -554,8 +565,19 @@ function redTestCheck(run) {
|
|
|
554
565
|
return run.config.gate.find((entry) => entry.name === RED_TEST_CHECK);
|
|
555
566
|
}
|
|
556
567
|
|
|
568
|
+
const COMPILE_ERROR_LINE =
|
|
569
|
+
/^error(?:\[[A-Z]\d+\])?: (?!could not compile|test failed|\d+ targets? failed).*$/m;
|
|
570
|
+
|
|
571
|
+
export function firstCompileError(output) {
|
|
572
|
+
return String(output).match(COMPILE_ERROR_LINE)?.[0] ?? null;
|
|
573
|
+
}
|
|
574
|
+
|
|
557
575
|
function missingCountMessage(output) {
|
|
558
|
-
|
|
576
|
+
const tail = output.slice(-FAILURE_TAIL);
|
|
577
|
+
const compileError = firstCompileError(output);
|
|
578
|
+
if (compileError) return `the tests do not compile: ${compileError}\n${tail}`;
|
|
579
|
+
|
|
580
|
+
return `the test run failed but reported no failing test count, so it does not prove the new tests fail:\n${tail}`;
|
|
559
581
|
}
|
|
560
582
|
|
|
561
583
|
function noRiseMessage(baseline, failing, output) {
|
|
@@ -591,7 +613,11 @@ function measureTestsRed(run, baseline) {
|
|
|
591
613
|
),
|
|
592
614
|
};
|
|
593
615
|
|
|
594
|
-
if (failing === null)
|
|
616
|
+
if (failing === null)
|
|
617
|
+
return {
|
|
618
|
+
stop: stuck(missingCountMessage(output)),
|
|
619
|
+
compileError: firstCompileError(output),
|
|
620
|
+
};
|
|
595
621
|
|
|
596
622
|
if (baseline !== undefined && failing <= baseline)
|
|
597
623
|
return { noRise: { failing, output } };
|
|
@@ -806,28 +832,49 @@ function testsAfterReplan(run) {
|
|
|
806
832
|
: null;
|
|
807
833
|
}
|
|
808
834
|
|
|
835
|
+
function retryTypistOnce(run, baseline, instructions, typist) {
|
|
836
|
+
const retried = gatedTestWriter(run, instructions, {
|
|
837
|
+
tier: "small",
|
|
838
|
+
resumeSessionId: typist.sessionId ?? undefined,
|
|
839
|
+
});
|
|
840
|
+
const stop = roleStop("test-writer", retried);
|
|
841
|
+
if (stop) return stop;
|
|
842
|
+
|
|
843
|
+
return proveTestsRed(run, baseline);
|
|
844
|
+
}
|
|
845
|
+
|
|
809
846
|
function retryUnitTests(run, baseline, failing, typist) {
|
|
810
847
|
const files = typistChangedFiles(run, typist.before, typist.after);
|
|
811
848
|
appendEvent(
|
|
812
849
|
{ event: UNIT_TESTS_NO_RISE_EVENT, task: run.id, baseline, failing, files },
|
|
813
850
|
run.env
|
|
814
851
|
);
|
|
815
|
-
|
|
852
|
+
|
|
853
|
+
return retryTypistOnce(
|
|
816
854
|
run,
|
|
855
|
+
baseline,
|
|
817
856
|
noRiseRetryInstructions(baseline, failing, files),
|
|
818
|
-
|
|
857
|
+
typist
|
|
819
858
|
);
|
|
820
|
-
|
|
821
|
-
if (stop) return stop;
|
|
859
|
+
}
|
|
822
860
|
|
|
823
|
-
|
|
861
|
+
function retryUncompiledUnitTests(run, baseline, error, typist) {
|
|
862
|
+
appendEvent(
|
|
863
|
+
{ event: UNIT_TESTS_NO_COMPILE_EVENT, task: run.id, baseline, error },
|
|
864
|
+
run.env
|
|
865
|
+
);
|
|
866
|
+
|
|
867
|
+
return retryTypistOnce(run, baseline, noCompileRetryInstructions(error), typist);
|
|
824
868
|
}
|
|
825
869
|
|
|
826
870
|
function proveUnitTestsRed(run, baseline, typist) {
|
|
827
871
|
const proof = measureTestsRed(run, baseline);
|
|
828
|
-
if (
|
|
872
|
+
if (proof.noRise) return retryUnitTests(run, baseline, proof.noRise.failing, typist);
|
|
873
|
+
|
|
874
|
+
if (proof.compileError)
|
|
875
|
+
return retryUncompiledUnitTests(run, baseline, proof.compileError, typist);
|
|
829
876
|
|
|
830
|
-
return
|
|
877
|
+
return proof.stop ?? null;
|
|
831
878
|
}
|
|
832
879
|
|
|
833
880
|
function unitTestsStep(run) {
|
|
@@ -1071,7 +1118,43 @@ export function editedTestFiles(run, start, fixesFrom) {
|
|
|
1071
1118
|
const changedByTree = changedFilesByTree(run, baselines, end);
|
|
1072
1119
|
if (changedByTree === null) return { stop: stuck(FINGERPRINT_UNREADABLE) };
|
|
1073
1120
|
|
|
1074
|
-
return { edits: editedBaselines(baselines, changedByTree) };
|
|
1121
|
+
return { edits: editedBaselines(baselines, changedByTree), end };
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
function testEditDiff(run, edit, end) {
|
|
1125
|
+
const diff = gitOutput(run, ["diff", edit.tree, end, "--", edit.file]) ?? "";
|
|
1126
|
+
|
|
1127
|
+
return `### ${edit.file}\n${diff.slice(0, TEST_EDIT_DIFF_LIMIT)}`;
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
function testEditsQuestion(run, edits, end) {
|
|
1131
|
+
const diffs = edits.map((edit) => testEditDiff(run, edit, end)).join("\n\n");
|
|
1132
|
+
|
|
1133
|
+
return `The code step changed these test files, and the code writer and the debugger never edit a test:
|
|
1134
|
+
|
|
1135
|
+
${diffs}
|
|
1136
|
+
|
|
1137
|
+
When a change only makes its test correct, contradicting no acceptance criterion and no Decision and weakening no check the spec asks for, put that file in testFix.files, and the change stays. Leave out every file whose change is not right: the build restores it, and the code writer makes the gate pass without it.`;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
function keepRuledTestEdits(run, edits, end, reply) {
|
|
1141
|
+
const named = requestedTestFix(reply.testFix)?.files ?? [];
|
|
1142
|
+
const kept = edits.filter((edit) => named.includes(edit.file)).map((edit) => edit.file);
|
|
1143
|
+
if (kept.length === 0) return edits;
|
|
1144
|
+
run.testFixTrees.push({ tree: end, files: kept });
|
|
1145
|
+
appendEvent({ event: TEST_EDITS_KEPT_EVENT, task: run.id, files: kept }, run.env);
|
|
1146
|
+
|
|
1147
|
+
return edits.filter((edit) => !kept.includes(edit.file));
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
function poRulesOnTestEdits(run, found) {
|
|
1151
|
+
if (run.testFixes >= TEST_FIX_LIMIT) return { edits: found.edits };
|
|
1152
|
+
run.testFixes += 1;
|
|
1153
|
+
const question = testEditsQuestion(run, found.edits, found.end);
|
|
1154
|
+
const reply = askPo(run, UNPLANNED_FILES_ASKER, question);
|
|
1155
|
+
if (reply.userQuestion) return { stop: waiting(reply.userQuestion) };
|
|
1156
|
+
|
|
1157
|
+
return { edits: keepRuledTestEdits(run, found.edits, found.end, reply) };
|
|
1075
1158
|
}
|
|
1076
1159
|
|
|
1077
1160
|
function testEditsStep(run, start, fixesFrom) {
|
|
@@ -1079,8 +1162,12 @@ function testEditsStep(run, start, fixesFrom) {
|
|
|
1079
1162
|
if (found.stop) return found.stop;
|
|
1080
1163
|
|
|
1081
1164
|
if (found.edits.length === 0) return null;
|
|
1165
|
+
const ruled = poRulesOnTestEdits(run, found);
|
|
1166
|
+
if (ruled.stop) return ruled.stop;
|
|
1167
|
+
|
|
1168
|
+
if (ruled.edits.length === 0) return null;
|
|
1082
1169
|
|
|
1083
|
-
return restoreTestEdits(run, start, fixesFrom,
|
|
1170
|
+
return restoreTestEdits(run, start, fixesFrom, ruled.edits);
|
|
1084
1171
|
}
|
|
1085
1172
|
|
|
1086
1173
|
function restoreTestEdits(run, start, fixesFrom, edits) {
|
|
@@ -48,7 +48,7 @@ The task's category decides the roles before and after the code (`roles.mjs` `CA
|
|
|
48
48
|
- **test-writer**, acceptance tests (sonnet): run `node $S/step.mjs baseline <id>` first. Instructions: "Write the failing acceptance tests from spec.md only; there is no plan yet, so do not read plan.md. Write tests.md in the task folder mapping each test to the acceptance criteria it covers. Leave the tests uncommitted; the code writer commits them with the code." Then gate it: `node $S/gate.mjs <worktree> <id> test-writer <attempt> sonnet`, attempt 1 to 3. A non-zero exit starts the test writer again with the gate's failed checks, at most 2 more times; a third failure stops the build `stuck` with the failed checks. When no gate entry in `.dark-factory.json` lists `test-writer`, the command runs nothing and passes. Then `node $S/step.mjs prove-red <id>`; a non-zero exit stops the build `stuck` with its message.
|
|
49
49
|
- **planner** (opus): "Write plan.md for this change. Failing acceptance tests already exist in the worktree (see tests.md in the task folder); the plan must make them pass without changing them." Without a test writer: "Write plan.md for this change."
|
|
50
50
|
- **Plan gate**, up to 2 rounds: start **reviewer** (sonnet) with "This is the plan gate: there is no code and no diff yet. Review plan.md against spec.md only. Report one finding for each place where the plan narrows an acceptance criterion; adds behaviour, events, options, flags, files or dependencies that no criterion asks for; contradicts the spec, its Decisions or its Must not change; or leaves a decision to the code writer." Settle each finding in the spec's Decisions and have the planner apply them.
|
|
51
|
-
- **Unit tests**, when there is a test writer and a plan: `step.mjs baseline`, then **test-writer** (haiku): "Type one unit test per row of each example table in plan.md, in the test files the plan names. Test only what the tables state, change no other file, and leave the tests
|
|
51
|
+
- **Unit tests**, when there is a test writer and a plan: `step.mjs baseline`, then **test-writer** (haiku): "Type one unit test per row of each example table in plan.md, in the test files the plan names. Test only what the tables state, change no other file except for those stubs, and leave everything uncommitted. When a test names a function, type or method that plan.md defines and that does not exist yet, add it where plan.md puts it, with the plan's signature and a body that only fails when it runs (todo!() in Rust, panic in Go, a thrown error elsewhere), so the tests compile and fail; the code writer replaces it. When plan.md has no example tables, change nothing." Gate it as the acceptance test writer is gated, with `node $S/gate.mjs <worktree> <id> test-writer <attempt> haiku`, also after a retry. When it changed files, `step.mjs prove-red`. On a no-rise, send it back once with the counts and the files it changed: a test file that fails to load counts as one failure, so it moves its tests into a new test file. When `prove-red` says the tests do not compile, send it back once with the first error and the stub rule above. A second failure of either kind stops `stuck`.
|
|
52
52
|
|
|
53
53
|
### 2. The code
|
|
54
54
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "modules": ["./register.tsx"] }
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { EngineInterface, Register } from "claude-code";
|
|
2
|
+
import { atom, read, update } from "claude-code";
|
|
3
|
+
|
|
4
|
+
import type { Notice } from "../types";
|
|
5
|
+
|
|
6
|
+
const notice = atom({ plugin: "pal-status", key: "notice" } as const, null as Notice);
|
|
7
|
+
|
|
8
|
+
const READ_HEALTH = ["sh", "-c", 'cat "$HOME/.pal/cache/health.json"'] as const;
|
|
9
|
+
const RECHECK_MS = 60_000;
|
|
10
|
+
|
|
11
|
+
function noticeIn(text: string): Notice {
|
|
12
|
+
try {
|
|
13
|
+
const parsed = JSON.parse(text) as { notice?: unknown };
|
|
14
|
+
|
|
15
|
+
return typeof parsed.notice === "string" && parsed.notice !== ""
|
|
16
|
+
? parsed.notice
|
|
17
|
+
: null;
|
|
18
|
+
} catch {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async function refresh($: EngineInterface): Promise<void> {
|
|
24
|
+
const run = await $.process.run(READ_HEALTH);
|
|
25
|
+
const current = run.exitCode === 0 ? noticeIn(run.stdout) : null;
|
|
26
|
+
await update($, notice, () => current);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const register: Register = (on) => {
|
|
30
|
+
on("session.start", async ($, e, next) => {
|
|
31
|
+
await refresh($);
|
|
32
|
+
$.clock.every(RECHECK_MS, () => refresh($));
|
|
33
|
+
|
|
34
|
+
return next(e);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
on("turn.complete", async ($, e, next) => {
|
|
38
|
+
await refresh($);
|
|
39
|
+
|
|
40
|
+
return next(e);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
on("ui.render", { component: "AbovePrompt" }, async ($, e, next) => {
|
|
44
|
+
const text = await read($, notice);
|
|
45
|
+
|
|
46
|
+
if (e.props.hasSurvey || text === null) {
|
|
47
|
+
return next(e);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const { Box, Text } = $.ui.resolve(e);
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<Box>
|
|
54
|
+
<Text color="yellow">⚠ {text} — pal cli doctor</Text>
|
|
55
|
+
</Box>
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
@@ -1,155 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://raw.githubusercontent.com/kovrichard/portable-agent-layer/main/assets/schema/pal-settings.schema.json",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": true,
|
|
8
|
-
"properties": {
|
|
9
|
-
"$schema": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "JSON Schema reference — enables editor autocomplete, validation, and hover docs."
|
|
12
|
-
},
|
|
13
|
-
"identity": {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"description": "Who the assistant is and who it serves.",
|
|
16
|
-
"additionalProperties": false,
|
|
17
|
-
"properties": {
|
|
18
|
-
"ai": {
|
|
19
|
-
"type": "object",
|
|
20
|
-
"description": "The assistant's persona.",
|
|
21
|
-
"additionalProperties": false,
|
|
22
|
-
"properties": {
|
|
23
|
-
"name": { "type": "string", "description": "Short name (e.g. the name you call the assistant)." },
|
|
24
|
-
"fullName": { "type": "string", "description": "Full/formal name." },
|
|
25
|
-
"displayName": { "type": "string", "description": "Uppercase label used in headers." },
|
|
26
|
-
"catchphrase": { "type": "string", "description": "Greeting line. '{name}' is substituted with the ai.name value." }
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"principal": {
|
|
30
|
-
"type": "object",
|
|
31
|
-
"description": "The human the assistant works for.",
|
|
32
|
-
"additionalProperties": false,
|
|
33
|
-
"properties": {
|
|
34
|
-
"name": { "type": "string", "description": "The principal's name." },
|
|
35
|
-
"timezone": { "type": "string", "description": "IANA timezone (e.g. Europe/Budapest)." }
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"loadAtStartup": {
|
|
41
|
-
"type": "object",
|
|
42
|
-
"description": "Files force-loaded into session context at startup. Injected as <system-reminder> blocks.",
|
|
43
|
-
"additionalProperties": false,
|
|
44
|
-
"properties": {
|
|
45
|
-
"files": {
|
|
46
|
-
"type": "array",
|
|
47
|
-
"description": "Absolute or PAL-relative file paths to inject at session start.",
|
|
48
|
-
"items": { "type": "string" }
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"dynamicContext": {
|
|
53
|
-
"type": "object",
|
|
54
|
-
"description": "Dynamic context sections injected at session start. Set any key to false to disable it; absent keys default to enabled.",
|
|
55
|
-
"additionalProperties": { "type": "boolean" },
|
|
56
|
-
"properties": {
|
|
57
|
-
"opinions": { "type": "boolean", "description": "Tracked user opinions." },
|
|
58
|
-
"projects": { "type": "boolean", "description": "Active projects list." },
|
|
59
|
-
"contextualSteering": { "type": "boolean", "description": "Prompt-time steering self-checks (see the steering section)." },
|
|
60
|
-
"skillMatching": {
|
|
61
|
-
"type": "boolean",
|
|
62
|
-
"description": "Prompt-time \"Potential matching skills\" hints, matched from each skill's metadata.triggers."
|
|
63
|
-
},
|
|
64
|
-
"wallClock": {
|
|
65
|
-
"type": "boolean",
|
|
66
|
-
"description": "One line of the current time with every prompt, in identity.principal.timezone, so a session resumed hours later knows the day changed."
|
|
67
|
-
},
|
|
68
|
-
"repoState": {
|
|
69
|
-
"type": "boolean",
|
|
70
|
-
"description": "One line with every prompt saying whether the work in the current directory is committed, pushed and released; a registered project without git is named as such."
|
|
71
|
-
},
|
|
72
|
-
"dueReminders": {
|
|
73
|
-
"type": "boolean",
|
|
74
|
-
"description": "Opt-in, off by default until 1.0. Due maintenance reminders (learning analysis, relationship reflect) with every prompt until a reply names their command; then quiet until the next day."
|
|
75
|
-
},
|
|
76
|
-
"interactionAwareness": {
|
|
77
|
-
"type": "boolean",
|
|
78
|
-
"description": "Measure each user turn (pace, message length, skimming, corrections; never the text) into memory/signals/interaction/, and tell the agent when the session's pattern changes."
|
|
79
|
-
},
|
|
80
|
-
"reactionSampling": {
|
|
81
|
-
"type": "boolean",
|
|
82
|
-
"description": "Keep a rolling local sample (about 230 messages) of user message text, its reaction label and the end of the reply it answered, in memory/state/reaction-samples.json, so the reaction rules can be audited. Stores message text; set false to keep none."
|
|
83
|
-
},
|
|
84
|
-
"claimCheck": {
|
|
85
|
-
"type": "boolean",
|
|
86
|
-
"description": "At each stop, check whether the final reply claims a result (tests pass, CI green, works now) or a status (not pushed, merged, live) that no command in that turn could have shown, and log the verdict to memory/signals/claim-checks/. A claim about what is committed, pushed, merged or released is backed only by a git or gh command. Stores the claiming sentence only when nothing backed it."
|
|
87
|
-
},
|
|
88
|
-
"claimCheckBlocks": {
|
|
89
|
-
"type": "boolean",
|
|
90
|
-
"description": "Opt-in, off by default. Send a reply with an unbacked result or status claim back to the agent once, asking it to show the output or say the result is unverified. Needs claimCheck. Not on Cursor, whose stop payload carries no reply text."
|
|
91
|
-
},
|
|
92
|
-
"adaptationRules": {
|
|
93
|
-
"type": "boolean",
|
|
94
|
-
"description": "Let the rules you approved from your past corrections steer the agent: a rule triggered by your prompt is injected before the agent answers, and a reply that matches a rule's trigger is sent back to the agent once at stop. Each firing is logged to memory/adaptation/rule-events.jsonl. Set false to switch every rule off. Reply-side rules do not run on Cursor, whose stop payload carries no reply text, or on opencode, whose plugin does not run the stop check."
|
|
95
|
-
},
|
|
96
|
-
"entityCards": {
|
|
97
|
-
"type": "boolean",
|
|
98
|
-
"description": "When a prompt names a person or company from the knowledge store, inject a short card about them before the agent answers. Reads files only; no model call."
|
|
99
|
-
},
|
|
100
|
-
"entityExtraction": {
|
|
101
|
-
"type": "boolean",
|
|
102
|
-
"description": "After a session stops, ask a background model which people and companies your own messages mentioned, and write clear matches and new full names to the knowledge store with the message as source. A name that could be more than one entry, or a first name alone, waits for `pal cli knowledge review` instead."
|
|
103
|
-
},
|
|
104
|
-
"entityResearch": {
|
|
105
|
-
"type": "boolean",
|
|
106
|
-
"description": "Opt-in, off by default. When extraction creates a company, or a person with a known organization, research it on the web through the active agent (up to three per stop): website, LinkedIn, social accounts, the company registry entry, recent news, each with its source. A profile the model is sure of waits in `pal cli knowledge review`; accepting writes it to the entry. The name and what you said about it reach the agent's web search. Claude Code, Codex and Copilot only. Needs entityExtraction."
|
|
107
|
-
},
|
|
108
|
-
"steeringTestReport": { "type": "boolean", "description": "When true, the assistant notes to the user which steering self-check fired. For the dual-live test period; ships false." }
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
"updateChannel": {
|
|
112
|
-
"enum": ["stable", "canary"],
|
|
113
|
-
"description": "Release channel that plain and unattended updates follow. Set by `pal cli update --canary` / `--stable`; absent means stable."
|
|
114
|
-
},
|
|
115
|
-
"attribution": {
|
|
116
|
-
"type": "object",
|
|
117
|
-
"description": "Git co-author attribution opt-in.",
|
|
118
|
-
"additionalProperties": false,
|
|
119
|
-
"properties": {
|
|
120
|
-
"enabled": { "type": "boolean", "description": "Add the PAL co-author trailer to commits." },
|
|
121
|
-
"decided": { "type": "boolean", "description": "Gates the one-time attribution prompt." }
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
"steering": {
|
|
125
|
-
"type": "object",
|
|
126
|
-
"description": "Contextual steering: PAL injects a short self-check into your prompt when it matches a task type. Toggle the whole feature via dynamicContext.contextualSteering.",
|
|
127
|
-
"additionalProperties": false,
|
|
128
|
-
"properties": {
|
|
129
|
-
"disable": {
|
|
130
|
-
"type": "array",
|
|
131
|
-
"description": "Shipped steering rules to suppress, by tag.",
|
|
132
|
-
"items": {
|
|
133
|
-
"type": "string",
|
|
134
|
-
"enum": ["debugging", "destructive", "refactor", "planning", "testing", "committing", "secrets"]
|
|
135
|
-
},
|
|
136
|
-
"uniqueItems": true
|
|
137
|
-
},
|
|
138
|
-
"rules": {
|
|
139
|
-
"type": "array",
|
|
140
|
-
"description": "Personal steering rules appended to the shipped set. A malformed entry (missing field or bad regex) is skipped, never fatal.",
|
|
141
|
-
"items": {
|
|
142
|
-
"type": "object",
|
|
143
|
-
"additionalProperties": false,
|
|
144
|
-
"required": ["tag", "pattern", "snippet"],
|
|
145
|
-
"properties": {
|
|
146
|
-
"tag": { "type": "string", "description": "Short identifier for this rule (also used to dedupe matches)." },
|
|
147
|
-
"pattern": { "type": "string", "description": "JavaScript regex source, matched case-insensitively against the prompt." },
|
|
148
|
-
"snippet": { "type": "string", "description": "The self-check text injected when the pattern matches." }
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
4
|
+
"description": "The former name of settings.schema.json, kept for settings files whose $schema still points here.",
|
|
5
|
+
"$ref": "settings.schema.json"
|
|
155
6
|
}
|