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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .context/DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- INDEX:START -->
| Date | Decision |
|----|--------|
| 2026-05-10 | Placeholder overrides use EXTEND not REPLACE semantics |
| 2026-05-10 | Editorial constitution at .context/ingest/KB-RULES.md, not CONSTITUTION.md |
| 2026-05-10 | Phase KB ships handover plus editorial paired, not split |
| 2026-05-10 | KB ontology is pipeline-only-writer; no /ctx-kb-decide parallel skill |
Expand Down Expand Up @@ -134,6 +135,20 @@ For significant decisions:

-->

## [2026-05-10-181404] Placeholder overrides use EXTEND not REPLACE semantics

**Status**: Accepted

**Context**: When localizing the placeholder set used by validate.RejectPlaceholder, .ctxrc gains a placeholders: list. The existing precedent (rc.SessionPrefixes) uses REPLACE semantics: any non-empty user list completely replaces the shipped defaults. Placeholders need a different rule.

**Decision**: Placeholder overrides use EXTEND not REPLACE semantics

**Rationale**: The dominant case in this codebase is Tarzan Turkish — bilingual EN+TR projects where users need both English (TBD, n/a, see chat) and Turkish (iptal, yapılacak, görüşülecek) placeholders rejected simultaneously. REPLACE would force users to re-list every English default just to add one Turkish term, which they would skip and silently lose half the validator's coverage. EXTEND appends user list onto the shipped defaults so partial overrides do not regress baseline protection.

**Consequence**: rc.Placeholders() must combine defaults + user list with case-folded de-duplication, diverging from the SessionPrefixes pattern. A future maintainer reading both accessors side-by-side will notice the inconsistency; the divergence is intentional and Spec: specs/placeholder-i18n.md captures why. If REPLACE is later wanted, add an opt-in placeholders_replace: true toggle rather than flipping the default.

---

## [2026-05-10-001857] Editorial constitution at .context/ingest/KB-RULES.md, not CONSTITUTION.md

**Status**: Accepted
Expand Down
11 changes: 11 additions & 0 deletions .context/LEARNINGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ DO NOT UPDATE FOR:
<!-- INDEX:START -->
| Date | Learning |
|----|--------|
| 2026-05-10 | Go compile/tool version mismatch comes from the cached toolchain, not the system Go |
| 2026-05-10 | An ongoing user's concrete workaround tax is the strongest validation evidence |
| 2026-05-10 | Lift renames alongside features when borrowing from battle-tested external designs |
| 2026-05-10 | KB epistemology: in a KB you do not decide, you increase confidence |
Expand Down Expand Up @@ -129,6 +130,16 @@ DO NOT UPDATE FOR:

---

## [2026-05-10-181418] Go compile/tool version mismatch comes from the cached toolchain, not the system Go

**Context**: Hit 'compile: version "go1.26.1" does not match go tool version "go1.26.2"' on every go build / go test / make lint, even with my changes stashed out. System Go was 1.26.2 (healthy); go.mod pinned 1.26.1, so Go's auto-toolchain feature had downloaded 1.26.1 to ~/go/pkg/mod/golang.org/toolchain@v0.0.1-go1.26.1.darwin-arm64/. That cached toolchain was internally inconsistent: its compile binary and stdlib export data disagreed on version.

**Lesson**: When the compile-vs-tool version error appears, the bug is the cached toolchain dir, not the installed Go. Reinstalling Go (brew, installer, etc.) does NOT touch the cached download, so the error persists after reinstall. Three real fixes: (1) rm -rf ~/go/pkg/mod/golang.org/toolchain@v0.0.1-go<X>.<platform>/ to force a clean re-download (~30s); (2) bump go.mod to match the system Go so the cached one is bypassed; (3) GOTOOLCHAIN=go<system version> to override the pin per-invocation. go clean -cache and GOTOOLCHAIN=local do not help.

**Application**: First diagnostic on this error: check go env GOROOT — if it points to ~/go/pkg/mod/golang.org/toolchain@... the cached toolchain is in play. Then either delete the cached dir (most surgical) or bump go.mod (one-line diff, but lands in a commit). Do not waste time reinstalling Go.

---

## [2026-05-10-001859] An ongoing user's concrete workaround tax is the strongest validation evidence

**Context**: When extracting the editorial pipeline, the user pointed at things-wtf-disaster-recovery as a project where they were already running the editorial pattern manually — but at concrete cost: CLAUDE.md disabling half of ctx code-dev skills (/ctx-commit, /ctx-implement, /ctx-spec, /ctx-architecture, /ctx-brainstorm, /ctx-wrap-up), 10-CONSTITUTION.md at repo root colliding with .context/CONSTITUTION.md, hand-typed 8-item closeouts, hand-managed 20-INBOX.md, dedicated reference/vcf/external-grounding.md for ground-mode. The workaround was visible and the pain was specific.
Expand Down
29 changes: 21 additions & 8 deletions .context/TASKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ TASK STATUS LABELS:
`--phase` flag too, and we can have a auditor/normalizer for the current
task document; or a skill that does a semantic pass, or both too.

- [ ] Localize the placeholder set used by `RejectPlaceholder`
(decision add / learning add and any future body-flag validators).
Move the shipped defaults out of `internal/config/validate/placeholder.go`
Go constants into an embedded YAML asset, add a `.ctxrc placeholders:`
override with EXTEND semantics (user list is appended to defaults, not
replacing them — Tarzan Turkish is the dominant case), and replace the
current `strings.ToLower` with proper Unicode case folding via
`golang.org/x/text/cases` so İ/i, ß/SS, and similar fold correctly.
Ship `en` only in v1; ctx has no locale-specific assets yet, so the
structure is established but no `tr.yaml` lands in this work.
Spec: `specs/placeholder-i18n.md` #priority:high #added:2026-05-11
#prerequisite-for-locale-work

### Misc


Expand Down Expand Up @@ -1715,17 +1728,17 @@ Spec: `specs/ceremony-profiles.md`

### Phase SK: Skill Surface Polish (Phase 0a; prerequisite for Phase KB) `#priority:high #added:2026-05-09`

Spec: TBD (design ref: `ideas/002-editorial-pipeline-and-skill-rigor.md` §3 "Reframing the wishy-washy skills")
Spec: `specs/skill-surface-polish.md` (design ref: `ideas/002-editorial-pipeline-and-skill-rigor.md` §3 "Reframing the wishy-washy skills")

Tightens existing capture skills to sibling-project rigor before the editorial pipeline (Phase KB) lifts that pattern wholesale. Independent of Phase RG; both can ship in parallel.

- [ ] Add `MarkFlagRequired` to `ctx decision add` for `--context`, `--rationale`, `--consequence`; reject placeholder values (`TBD`, `see chat`, whitespace-only) at CLI level
- [ ] Add `MarkFlagRequired` to `ctx learning add` for `--context`, `--lesson`, `--application`; same placeholder rejection
- [ ] Add `--brief <path>` flag to `/ctx-spec` skill: when present, read the file as authoritative source per the sibling's authority order (frozen contracts > recorded decisions > debrief > agent inference labeled `TBD`); skip the fresh template Q&A
- [ ] Update `/ctx-plan` skill to always offer to write the debated brief to `.context/briefs/<TS>-<slug>.md` at the end of an interview (creating `.context/briefs/` if absent)
- [ ] Add an `Authority boundary (vs other skills)` section to `/ctx-decision-add`, `/ctx-learning-add`, `/ctx-task-add`, `/ctx-convention-add` skill files (prevent silent promotion handover→decision, learning→convention, etc., without explicit user ask)
- [ ] Standardize "light compression for clarity is allowed; new facts are not" wording across capture skills (decide / learn primarily); same wording lands in `/ctx-handover` once Phase KB ships
- [ ] Document the `--brief` contract in `docs/skills.md`
- [x] Add `MarkFlagRequired` to `ctx decision add` for `--context`, `--rationale`, `--consequence`; reject placeholder values (`TBD`, `see chat`, whitespace-only) at CLI level
- [x] Add `MarkFlagRequired` to `ctx learning add` for `--context`, `--lesson`, `--application`; same placeholder rejection
- [x] Add `--brief <path>` flag to `/ctx-spec` skill: when present, read the file as authoritative source per the sibling's authority order (frozen contracts > recorded decisions > debrief > agent inference labeled `TBD`); skip the fresh template Q&A
- [x] Update `/ctx-plan` skill to always offer to write the debated brief to `.context/briefs/<TS>-<slug>.md` at the end of an interview (creating `.context/briefs/` if absent)
- [x] Add an `Authority boundary (vs other skills)` section to `/ctx-decision-add`, `/ctx-learning-add`, `/ctx-task-add`, `/ctx-convention-add` skill files (prevent silent promotion handover→decision, learning→convention, etc., without explicit user ask)
- [x] Standardize "light compression for clarity is allowed; new facts are not" wording across capture skills (decide / learn primarily); same wording lands in `/ctx-handover` once Phase KB ships
- [x] Document the `--brief` contract in `docs/skills.md` (landed in `docs/reference/skills.md` — the actual location)

### Phase RG: Require Git as Architectural Precondition (Phase 0b; prerequisite for Phase KB) `#priority:high #added:2026-05-09`

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
---
generated-at: 2026-05-11T00:08:47Z
---
# Handover [2026-05-11-000847] Phase SK shipped; 4 polish items on `internal/validate.BodyFlags` for next session

**Provenance:** commit `971bf767` on branch `feat/skill-surface-polish`

## Summary

Phase SK (Skill Surface Polish) — all 7 tasks landed across
6 commits on branch `feat/skill-surface-polish` (off `main` at
`a44edfe3`):

```
971bf767 refactor(validate): consolidate body-flag helpers into internal/validate
ba2faa54 refactor(validate): pure BodyFlags, no PreRunE decoration
1156e44a docs(blog): align thought-piece bylines (← unrelated, stacked intentionally)
92507039 refactor(validate): single PreRunE enforcement, no panic, no swallowed errors
55acbd81 feat(skills): /ctx-spec --brief, authority boundaries, plan brief offer
f32c8fd9 feat(validate): require body flags on decision/learning add
```

All signed off, `make lint` 0 issues, `go test ./...` 0 failures,
working tree clean. Branch is local-only (not pushed). Spec is at
`specs/skill-surface-polish.md`; design ref at
`ideas/002-editorial-pipeline-and-skill-rigor.md` §3.

The 5-commit churn on the `validate` package (4 commits between
`f32c8fd9` and `971bf767`) reflects iterative correction during
the session — each commit removed a code-smell the previous one
introduced. Functionally correct now, but the API surface still
has 4 specific polish items the user surfaced at session end.
They are non-blocking (the code works, the tests pass) but
should be addressed before PR review.

## Outstanding polish items (next session)

All in `internal/validate/` and its two call sites
(`internal/cli/decision/cmd/add/cmd.go`,
`internal/cli/learning/cmd/add/cmd.go`):

### 1. `RejectPlaceholder` should be unexported

Currently exported as `validate.RejectPlaceholder`. Only call
site is `BodyFlags` in the same package. Rename to
`rejectPlaceholder`. Update test references.

### 2. Per-file convention: private helper lives alone

Convention check confirmed by `internal/sanitize/truncate.go`
(single unexported `truncate` in its own file). After renaming,
move the helper to `internal/validate/rejectplaceholder.go` and
its tests to `internal/validate/rejectplaceholder_test.go`. The
remaining `bodyflags.go` should hold only `BodyFlags`.

### 3. `BodyFlags` takes too much

```go
// Current
func BodyFlags(c *cobra.Command, flags ...string) error
```

Only uses `c.Flags()`. Change to:

```go
func BodyFlags(flags *pflag.FlagSet, names ...string) error
```

Call site:
```go
c.PreRunE = func(cobraCmd *cobra.Command, _ []string) error {
return validate.BodyFlags(cobraCmd.Flags(), cFlag.Context, ...)
}
```

Update tests — the fixture no longer needs a full
`cobra.Command`; constructing a `pflag.FlagSet` with two flags
and calling `Parse(args)` is simpler.

### 4. `Placeholders` map shape is confusing

`internal/config/validate/placeholder.go` currently defines:

```go
const (
PlaceholderTBD = "tbd"
PlaceholderNA = "n/a"
...
)

var Placeholders = map[string]struct{}{
PlaceholderTBD: {}, // reads as if the key were the identifier
PlaceholderNA: {},
...
}
```

In a map literal, `PlaceholderTBD:` evaluates to its const value
`"tbd"` — the map key stored is the string, not the identifier.
The user surfaced this as a real code smell: the surface reads
"enum-keyed map" but it's actually a string-keyed set.

**Resolution**: switch to a slice + linear scan (N=9; cost is
negligible):

```go
var placeholders = []string{
PlaceholderTBD, PlaceholderNA, PlaceholderNAShort,
PlaceholderNone, PlaceholderSeeChat, PlaceholderSeeAbove,
PlaceholderSeeBelow, PlaceholderPending, PlaceholderToBeDone,
}
```

```go
// in rejectPlaceholder
key := strings.ToLower(strings.TrimSpace(value))
for _, p := range cfgValidate.Placeholders {
if key == p {
return errCli.FlagPlaceholder(flag, value)
}
}
```

The slice's contents are the same constants, and the slice name
documents the set's purpose without map-key sleight-of-hand. The
audit's magic-strings check passes because every literal lives
in `const PlaceholderXxx`.

After the rename, `Placeholders` (capital P) should be
`placeholders` (private) since only `internal/validate` reads it.

## Gating

- Each item, when fixed, requires the normal gate: `make lint`
clean, `go test ./...` clean, working tree clean before any
commit.
- Sign every commit (`git commit -s`).
- Do not add a `Co-Authored-By:` line to commits.
- Stay on `feat/skill-surface-polish`; the branch is the
active feature branch and stacking polish on top is intended.
- The 4 items are independent; one focused commit per item is
fine, or fold into a single `refactor(validate): polish surface`
commit if the diff stays small.

## Session meta — read before resuming

This session accumulated 5 saved feedback memories in
`~/.claude/projects/-Users-volkan-Desktop-WORKSPACE-ctx/memory/`
(2026-05-10), all from the same root cause: I acted on first
impulse instead of grepping the codebase before scaffolding or
editing. Specifically saved:

- `feedback_no_coauthored_by.md` — strip Claude line only, never
the whole signoff block
- `feedback_branch_before_commit.md` — branch off main first;
honour "stacking is intentional"
- `feedback_always_signoff.md` — DCO requires `git commit -s`
- `feedback_no_silent_errors_no_panic.md` — propagate errors, no
`_ =` or `panic` outside `Must`-prefixed functions
- `feedback_no_silent_decoration.md` — helpers do not wrap
caller's cobra hooks
- `feedback_grep_before_creating_packages.md` — extend existing
packages by default

The user observed the cumulative drift mid-session and offered
the handover. Resuming agent: **read those memory files first.**
The 4 polish items above are technically small but every fix
this session has introduced a new issue. Slow down: read the
target file fully, grep for the convention, then edit.

## Next session

1. Pull this branch (`feat/skill-surface-polish @ 971bf767`).
2. Read `internal/validate/bodyflags.go` and
`internal/config/validate/placeholder.go` end-to-end.
3. Read `internal/sanitize/truncate.go` for the
single-private-helper-per-file pattern.
4. Apply items 1–4 above. One or four commits, either is fine.
5. After lint+test green and tree clean, hand back for push.

Optional follow-up after the 4 fixes land: open the PR. PR body
draft already prepared mid-session; see commit `55acbd81` body
for the user-facing scope summary.

## Open questions

None. The 4 polish items have unambiguous resolutions above.
The user-visible behaviour (decision/learning reject empty and
placeholder body flags) is correct and tested. Polish is purely
about code shape and API surface.
4 changes: 2 additions & 2 deletions docs/blog/2026-02-03-the-attention-budget.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "The Attention Budget: Why Your AI Forgets What You Just Told It"
date: 2026-02-03
author: Jose Alekhinne
author: Volkan Özçelik
reviewed_and_finalized: true
topics:
- attention mechanics
Expand All @@ -24,7 +24,7 @@ topics:

## Why Your AI Forgets What You Just Told It

*Jose Alekhinne / 2026-02-03*
*Volkan Özçelik / 2026-02-03*

!!! question "Ever Wondered Why AI Gets Worse the Longer You Talk?"
You paste a 2000-line file, explain the bug in detail, provide three
Expand Down
4 changes: 2 additions & 2 deletions docs/blog/2026-02-04-skills-that-fight-the-platform.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Skills That Fight the Platform"
date: 2026-02-04
author: Jose Alekhinne
author: Volkan Özçelik
reviewed_and_finalized: true
topics:
- context engineering
Expand All @@ -17,7 +17,7 @@ topics:

## When Your Custom Prompts Work against You

*Jose Alekhinne / 2026-02-04*
*Volkan Özçelik / 2026-02-04*

!!! question "Have You Ever Written a Skill That Made Your AI Worse?"
You craft detailed instructions. You add examples. You build elaborate
Expand Down
4 changes: 2 additions & 2 deletions docs/blog/2026-02-05-you-cant-import-expertise.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "You Can't Import Expertise"
date: 2026-02-05
author: Jose Alekhinne
author: Volkan Özçelik
reviewed_and_finalized: true
topics:
- skill adaptation
Expand All @@ -17,7 +17,7 @@ topics:

## Why Good Skills Can't Be Copy-Pasted

*Jose Alekhinne / 2026-02-05*
*Volkan Özçelik / 2026-02-05*

!!! question "Have You Ever Dropped a Well-Crafted Template into a Project and Had It Do... Nothing Useful?"
* The template was **thorough**,
Expand Down
4 changes: 2 additions & 2 deletions docs/blog/2026-02-09-defense-in-depth-securing-ai-agents.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Defense in Depth: Securing AI Agents"
date: 2026-02-09
author: Jose Alekhinne
author: Volkan Özçelik
reviewed_and_finalized: true
topics:
- agent security
Expand All @@ -17,7 +17,7 @@ topics:

## When Markdown Is Not a Security Boundary

*Jose Alekhinne / 2026-02-09*
*Volkan Özçelik / 2026-02-09*

!!! question "What Happens When Your AI Agent Runs Overnight and Nobody Is Watching?"
It follows instructions: **That is the problem**.
Expand Down
4 changes: 2 additions & 2 deletions docs/blog/2026-02-12-how-deep-is-too-deep.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "How Deep Is Too Deep?"
date: 2026-02-12
author: Jose Alekhinne
author: Volkan Özçelik
reviewed_and_finalized: true
topics:
- AI foundations
Expand All @@ -17,7 +17,7 @@ topics:

## When "Master ML" Is the Wrong Next Step

*Jose Alekhinne / 2026-02-12*
*Volkan Özçelik / 2026-02-12*

!!! question "Have You Ever Felt like You Should Understand More of the Stack beneath You?"
You can talk about transformers at a whiteboard.
Expand Down
2 changes: 1 addition & 1 deletion docs/blog/2026-02-14-irc-as-context.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Before Context Windows, We Had Bouncers"
date: 2026-02-14
author: Jose Alekhinne
author: Volkan Özçelik
reviewed_and_finalized: true
topics:
- context engineering
Expand Down
Loading
Loading