Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 9 additions & 0 deletions .context/CONSTITUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ Leave the system in a better state than you found it.
no exceptions, no "non-trivial" qualifier. Even one-liner fixes
need a spec for traceability. Use `/ctx-commit` instead of raw
`git commit`.
- [ ] **Git is required.** Every `ctx` project must live in a git
working tree. `ctx init` and every non-administrative
subcommand refuse to operate when `<projectRoot>/.git` is
absent. Rationale: ctx's persistent-memory promise is
dishonest without an undo layer; agent-driven file
operations need `git reflog` as the safety net. The only
opt-outs are help-shaped / diagnostic commands
(`--help`, `--version`, `ctx system bootstrap`). Per
`specs/require-git.md`.

## TASKS.md Structure Invariants

Expand Down
26 changes: 25 additions & 1 deletion .context/CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ DO NOT UPDATE FOR:
- **Package name = folder name**: Go canonical pattern
- `package initialize` in `initialize/` folder
- Never `package initcmd` in `init/` folder
- **Go package names: lowercase, no underscores, no
mixedCaps**: per the [Effective Go](https://go.dev/blog/package-names)
guidance and the stdlib precedent (`strconv`, `httptest`,
`bufio`). Apply to the directory too — `internal/flagbind/`,
not `internal/flag_bind/`. Filenames may use underscores
(`foo_test.go` is canonical); package names may not. When in
doubt, find the closest stdlib analogue and copy its shape.
- **Maps reference constants**: Use constants as keys, not literals
- `map[string]X{ConstKey: value}` not `map[string]X{"literal": value}`

Expand Down Expand Up @@ -220,6 +227,22 @@ DO NOT UPDATE FOR:
- **Error constructors in internal/err**: Never in per-package err.go
files — eliminates the broken-window pattern where agents add local
errors when they see a local err.go exists
- **Identity sentinels are `entity.Sentinel` consts, not
`errors.New`**: Declare `errors.Is` targets as
`const ErrX = entity.Sentinel(text.DescKey...)`. The
user-facing text lives in `commands/text/errors.yaml` keyed by
`err.<pkg>.<name>`; the sentinel's `Error()` resolves it via
`desc.Text` at call time. Never write
`var ErrX = errors.New("english")` — the English leaks into
`.Error()` output and bypasses localization. Never add an
`ErrMsg* = "english"` const layer in `internal/config/<pkg>/`
to back the sentinel; that layer is dead text once the typed
Sentinel does the lookup itself.
- **Parameterised errors use typed structs**: When the error
needs to carry fields (path, name, etc.), define a struct in
`internal/err/<area>/` with a pointer-receiver `Error()` and
optional `Is(error) bool` for sentinel-compatibility. See
`internal/err/context.NotFoundError` for the canonical shape.

## CLI Structure

Expand Down Expand Up @@ -270,4 +293,5 @@ DO NOT UPDATE FOR:
capitalization would otherwise apply: write `CONSTITUTION.md`, not
CONSTITUTION.Md. The title-case engine refuses to capitalize lowercase tokens
following a literal . dot, but explicit backticks remain the clearest signal.
- New editor integrations include an MCP-merge test covering: create / empty file / preserve existing keys / skip when registered / reject malformed JSON
- New editor integrations include an MCP-merge test covering: create / empty
file / preserve existing keys / skip when registered / reject malformed JSON
2 changes: 1 addition & 1 deletion .context/DANGER-ZONES.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Enriched 2026-04-03 via GitNexus (blast radius verified)._

1. **DiscoverPath coupling** - 7 direct callers across 4 modules
(Memory, Publish, Session, Ctximport). All 6 memory subcommands
+ check_memory_drift hook depend on this. 7 execution flows.
+ checkmemorydrift hook depend on this. 7 execution flows.
- Blast radius: d=1: 7, flows: 7, modules: 4
- Risk: CRITICAL (enriched 2026-04-03 via GitNexus)
- Modification advice: slug format change breaks all memory
Expand Down
435 changes: 379 additions & 56 deletions .context/DECISIONS.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .context/DETAILED_DESIGN-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ core/ taxonomy per Decision 2026-03-06. Key structural changes:
- **journal**: consumed recall (Decision 2026-03-30); subcommands:
source, importer, lock, unlock, sync, site, obsidian
- **system**: expanded to 34 hook subcommands including various
check_*, block_*, post_commit, mark_*, cleanup_*
check_*, block_*, postcommit, mark_*, cleanup_*
- **recall**: deleted — merged into journal

**Danger zones**:
Expand Down
4 changes: 2 additions & 2 deletions .context/DETAILED_DESIGN-mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ config/mcp/tool (handler side)
| ctx_watch_update | No | Apply structured updates |
| ctx_compact | No | Archive completed tasks |
| ctx_next | Yes | Next pending task |
| ctx_check_task_completion | Yes | Match action to tasks |
| ctx_session_event | No | Signal session start/end |
| ctx_checktaskcompletion | Yes | Match action to tasks |
| ctx_sessionevent | No | Signal session start/end |
| ctx_remind | Yes | List pending reminders |

## Resources (9 total)
Expand Down
4 changes: 2 additions & 2 deletions .context/EXTENSION-POINTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Registration: `journal/parser` auto-detection via `Matches(path)`
Registered implementations:
1. `ClaudeCode` - `internal/journal/parser/claude.go`
2. `Copilot` - `internal/journal/parser/copilot.go`
3. `CopilotCLI` - `internal/journal/parser/copilot_cli.go`
3. `CopilotCLI` - `internal/journal/parser/copilotcli.go`
4. `MarkdownSession` - `internal/journal/parser/markdown.go`

How to extend: implement SessionParser interface with `Matches()`
Expand Down Expand Up @@ -76,7 +76,7 @@ Registration: `internal/cli/setup/core/*` packages
5 tool-specific deployers:
1. `agents/` - AGENTS.md deployment
2. `copilot/` - GitHub Copilot (instructions + VS Code MCP)
3. `copilot_cli/` - Copilot CLI (instructions, skills, agent, MCP)
3. `copilotcli/` - Copilot CLI (instructions, skills, agent, MCP)
4. (Claude Code via initialize, not setup)
5. (Cursor/Aider/Windsurf via simpler paths)

Expand Down
6 changes: 3 additions & 3 deletions .context/HANDOVER-2026-04-22.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ Sharpened the "explicit declaration or nothing" model:

`internal/cli/system/core/check/full_preamble.go` now returns
`(input, sessionID, ctxDir, stateDir, ok)`. All 16 callers
updated. 4 hooks (`check_persistence`, `check_memory_drift`,
`check_ceremony`, `check_journal`) had their redundant
updated. 4 hooks (`checkpersistence`, `checkmemorydrift`,
`checkceremony`, `checkjournal`) had their redundant
`errors.Is(ctxErr, ErrDirNotDeclared)` blocks deleted and use the
preamble's `ctxDir` directly. The 3 non-FullPreamble hooks
(`context_load_gate`, `check_context_size`, `heartbeat`) had
(`contextloadgate`, `checkcontextsize`, `heartbeat`) had
their `ErrDirNotDeclared` branches replaced with a defensive
"unreachable but log loudly" fallback after the `state.Initialized`
gate.
Expand Down
Loading
Loading