Repository navigation
2026.10.03 - Phase 2: Pi DCP Correctness and Configuration Safety - #72
Merged
lanhhoang merged 8 commits intoOct 4, 2026
Merged
Conversation
… cache, and harden config safety
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
read,write, andeditnow read Pi'spathfield in addition to legacyfilePathon every tool, normalize Windows separators, dedupe, and preserve order. Nested calls recorded on a tool result (e.g. fromcodemode) are inspected too, so a parent tool result is protected when any direct or nested file path matchesprotectedFilePatterns(src/strategies/protected-patterns.ts,src/state/tool-cache.ts,src/state/types.ts,src/strategies/runner.ts,tests/protected-patterns.test.ts,tests/tool-cache.test.ts,tests/strategy-runner.test.ts).@earendil-works/pi-agent-coreand@earendil-works/pi-coding-agentmove from^1.0.0to^1.0.1indevDependenciesso the checked-inAgentMessagetypes exposetoolResult.nestedCalls; the exact*peer ranges are preserved and no runtime dependency was added (package.json,pnpm-lock.yaml,pnpm-workspace.yaml).maxContextLimit/minContextLimitand their per-model entries accept only a positive integer token count or a percentage string greater than 0 and at most 100. Anything else is dropped with a warning instead of aborting startup (src/config-schema.ts,src/config-validation.ts,src/utils/context-limits.ts,tests/config.test.ts,tests/context-limits.test.ts).sanitizeConfigLayerwalks each layer once with a schema-guided recursion: declared objects retain supplied valid siblings,Type.Recordvalues are validated independently, arrays/unions/scalars go throughValue.Checkwith collapsed union errors, and unknown or invalid fields emit one warning per RFC 6901-escaped JSON pointer including the source file. InloadConfig, the sanitized value is deep-merged over the accumulated config, so an invalid global field keeps the built-in default and an invalid project field inherits the valid global value rather than resetting it. LegacymaxContextPercent/minContextPercentcross-checks are relabeled as merged-configuration diagnostics (src/config.ts,src/config-validation.ts,src/logger.ts).reloadConfigwrites each warning vialogger.warn("config", ...)and, whenctx.hasUIis true, emits exactly oneui.notify(..., "warning")containing the problem count and the participating global/project config paths. Raw configuration values are never included in the UI summary. The initial module-levelloadConfigcall stays silent;session_startowns the visible reload (src/index.ts,tests/index.test.ts).nudgeForce— eligible user/assistant pairs are anchored atomically: the user message and the nearest earlier assistant are both added in one branch, and frequency is measured against existing user-role turn anchors only (the assistant half of a prior pair never suppresses a later pair).strongrenders the nudge in the user role;softrenders it in the assistant role, including a synthetic text part inserted before the first tool call of a tool-only assistant message. Context-limit and iteration anchors are unchanged, and the version-1 snapshot shape is preserved (src/messages/inject.ts,tests/anchored-nudges.test.ts,tests/inject.test.ts,tests/pipeline.test.ts,tests/summary-buffer.test.ts).package.json);CHANGELOG.mdadds a[0.7.0] - 2026-10-03entry;README.mdreplaces the 0.6.1 block with a focused "What's new in 0.7.0" section covering Pi path protection, bounded context limits, layer fallback, one-summary-per-reload, and strong/soft turn nudges.dcp.schema.jsonis regenerated and now exposesintegerwithminimum: 1and the^\d+(?:\.\d+)?%$percentage pattern for the global and per-model limit fields (package.json,CHANGELOG.md,README.md,dcp.schema.json).docs/superpowers/specs/2026-10-03-pi-dcp-improvement-roadmap-design.md,docs/superpowers/plans/2026-10-03-phase-02-pi-dcp-correctness-config-safety.md).Automatic pruning timing, canonical IDs, compression behavior, and the version-1 persisted snapshot shape remain unchanged; no new runtime dependencies, no published Pi or OpenCode reference repositories, and no release workflow were touched. Verified end-to-end with
pnpm check(format, warning-free lint, typecheck, 570/570 tests),pnpm run pack:dry-run(pi-vault-pi-dcp-0.7.0.tgzships only the intended source/schema/docs), andpnpm benchmark(three workloads complete without correctness failures).