These tickets rebuild the local Python product around the new decisions in
notes.md. They are ordered. Do not skip ahead: later tickets depend on the
data model, paths, and command contracts from earlier tickets.
Goal: make the public contract unambiguous before changing internals.
Todos:
- Update product docs to say the only repo wiki root is
almanac/. - Remove
docs/almanac/,.almanac/, custom root, hosted, and compatibility language. - Document the existing
.almanac/directory as legacy repo memory to migrate, not as a supported root. - Keep the public CLI name as
codealmanac. - Remove
almanacandalmaliases if any exist. - Update README, AGENTS.md, MANUAL.md, and
docs/python-port-live-agreement.md. - Update public contract tests to assert the new contract.
Verification:
uv run pytest tests/test_public_contract.pyuv run ruff check src/codealmanac/cli/parser/lifecycle.py src/codealmanac/cli/dispatch/build.py src/codealmanac/services/workspaces/roots.py src/codealmanac/services/workspaces/service.py tests/test_public_contract.py- Focused text scan: active public docs must not advertise alternate roots,
--root, old command aliases, old page layout, wikilinks, orfiles:. Mentions of.almanac/are allowed only when explicitly labeled legacy migration input.
Goal: make the committed wiki a browsable documentation tree.
Todos:
- Remove the
almanac/pages/storage assumption. - Treat every markdown file under
almanac/as a page, except reserved files. - Support nested folders at any depth.
- Use the page path under
almanac/as the page id. - Map page ids like
architecture/viewer/navigation/sidebarto files likealmanac/architecture/viewer/navigation/sidebar.md. - Define README route behavior:
almanac/README.md->READMEalmanac/architecture/README.md->architecture
- Reject route collisions such as:
almanac/architecture.mdalmanac/architecture/README.md
- Remove
slug:as a required or meaningful page identity field.
Files:
src/codealmanac/services/wiki/documents.pysrc/codealmanac/services/wiki/frontmatter.pysrc/codealmanac/services/wiki/paths.pysrc/codealmanac/services/index/src/codealmanac/services/pages/tests/test_wiki_parsing.pytests/test_read_model.pytests/test_cli.py
Verification:
- Add tests for nested pages.
- Add tests for README route mapping.
- Add tests for route collision failures.
uv run pytest tests/test_wiki_parsing.py tests/test_read_model.py tests/test_cli.py
Goal: carry forward useful project memory without preserving the old product model.
Todos:
- Read
.almanac/README.md,.almanac/topics.yaml, and.almanac/pages/*.md. - Keep facts that still apply to the local-first Python product.
- Drop hosted/cloud assumptions, old root rules, old
pages/layout rules, wikilink guidance,files:compatibility, and old command names. - Rewrite surviving pages into the new nested
almanac/tree. - Use Markdown links and
sources:in the new page format. - Remove
.almanac/from active product docs after migration.
Verification:
codealmanac validaterg "\\.almanac|\\[\\[|files:" almanac README.md AGENTS.md MANUAL.md docs src tests
Goal: use one evidence model.
Todos:
- Remove
files:support from new page parsing. - Remove docs that mention
files:as a supported page field. - Represent file evidence only through
sources:entries withtype: file. - Derive
search --mentionsdata fromsources[type=file]. - Validate source entries have
id,type, and the required target field. - Update tests that currently rely on
files:.
Example:
sources:
- id: viewer-main
type: file
path: src/codealmanac/server/assets/viewer/main.js
note: Client-side viewer entrypoint.Verification:
rg "files:" src tests README.md AGENTS.md MANUAL.md docsuv run pytest tests/test_wiki_parsing.py tests/test_search.py tests/test_read_model.py
Goal: make page links feel like normal docs.
Todos:
- Stop treating
[[...]]as the authored page-link format. - Parse root-style Markdown links as page links:
[Sidebar](/architecture/viewer/navigation/sidebar)
- Keep repo file references in
sources:, not wikilinks. - Remove wikilink docs from prompts, manual, README, and AGENTS.md.
- Update backlink extraction to use Markdown page links.
- Update broken-link health checks for Markdown links.
Verification:
- Add tests for Markdown page links.
- Add tests for backlink extraction from Markdown links.
- Add tests that wikilinks are not required anywhere in new pages.
uv run pytest tests/test_wiki_parsing.py tests/test_health.py tests/test_read_model.py
Goal: keep committed almanac/ clean.
Todos:
- Keep global registry at
~/.codealmanac/registry.json. - Add a per-repo runtime directory:
~/.codealmanac/repos/<repo-id>/
- Move derived index state there:
index.dbindex.db-walindex.db-shm
- Move run state there:
runs/run_123.jsonruns/run_123.jsonlruns/run_123.spec.json
- Keep one SQLite DB per repo.
- Make missing runtime state rebuildable.
- Remove runtime
.gitignoreentries that were only needed insidealmanac/.
Files:
src/codealmanac/core/paths.pysrc/codealmanac/services/workspaces/src/codealmanac/services/index/schema.pysrc/codealmanac/services/runs/paths.pysrc/codealmanac/services/runs/io.pysrc/codealmanac/services/wiki/templates.py
Verification:
- Tests prove
almanac/contains only wiki source files. - Tests prove index/runs land under
~/.codealmanac/repos/<repo-id>/. uv run pytest tests/test_run_queue_workflow.py tests/test_viewer_service.py tests/test_read_model.py
Goal: give agents and lifecycle runs one concrete correctness check.
Todos:
- Add
codealmanac validate. - Validate page ids and route collisions.
- Validate Markdown links resolve.
- Validate
sources:shape. - Validate file sources point to real repo paths in the current checkout.
- Validate the derived DB/index matches the current markdown tree.
- Validate runtime files are not inside committed
almanac/. - Run validation automatically before a lifecycle run finishes.
Files:
src/codealmanac/services/health/src/codealmanac/cli/parser/wiki.pysrc/codealmanac/cli/dispatch/wiki.pysrc/codealmanac/cli/render/tests/test_health.pytests/test_cli.py
Verification:
codealmanac validatepasses on a good wiki.codealmanac validatefails on a broken Markdown link.codealmanac validatefails on route collisions.uv run pytest tests/test_health.py tests/test_cli.py
Goal: import the new prompt/manual work carefully, without cloud bloat.
Todos:
- Compare
e773dc0bagainstdevfor:src/codealmanac/prompts/src/codealmanac/manual/- relevant
docs/almanac/material
- Bring over the new prompt/manual content that matches the local product.
- Do not blindly check out cloud-era files.
- Remove hosted/cloud assumptions.
- Rewrite prompt/manual rules for:
- only
almanac/ - nested folder pages
- no
pages/ sources:only- Markdown links
- no slugs
- no wikilinks
- path-first page ids
- auto-commit default
- home-dir runtime state
- only
- Update prompt model enums/resources.
- Update package-data tests.
Diff commands:
git diff --name-status e773dc0b..dev -- src/codealmanac/prompts src/codealmanac/manual docs/almanac
git show dev:src/codealmanac/prompts/base/kernel.md
git show dev:src/codealmanac/prompts/operations/ingest.md
git show dev:src/codealmanac/prompts/operations/garden.mdVerification:
- Prompt rendering tests pass.
- Public contract tests pass.
- Manual text contains the new product rules.
uv run pytest tests/test_public_contract.py tests/test_prompts.py
Goal: explicit runs can edit the current wiki state without requiring a clean
almanac/.
Todos:
- Remove the clean-
almanac/preflight block. - Keep before/after Git snapshots.
- Allow pre-existing
almanac/changes. - Reject agent changes outside
almanac/. - Validate the final wiki.
- Keep run event ordering: persist events before page-write mutations where applicable.
- Make safety errors clear and actionable.
Files:
src/codealmanac/workflows/lifecycle_mutation.pysrc/codealmanac/workflows/page_run/service.pytests/test_ingest_workflow.pytests/test_garden_workflow.py
Verification:
- Test dirty
almanac/before run is allowed. - Test dirty source file before run does not matter.
- Test agent-created source-file change fails.
uv run pytest tests/test_ingest_workflow.py tests/test_garden_workflow.py
Goal: make auto-commit a prompt-level permission, not CodeAlmanac Git orchestration.
Todos:
- Add
auto_commit = truedefault config. - Add
codealmanac setup --no-auto-commit. - Add
codealmanac config set auto_commit false. - When enabled, include source-control runtime context in lifecycle prompts:
- committing wiki source changes is allowed,
- use normal
gitcommands, - commit only wiki source files,
- use commit message shape
almanac: <summary>.
- When disabled, include prompt context that says not to commit.
- Do not add a Git committer service.
- Do not stage files inside CodeAlmanac.
- Do not split pre-existing
almanac/edits from agent edits. - Do not transport commits across branches or worktrees.
- Prompt-allowed wiki source files:
almanac/**/*.mdalmanac/topics.yamlalmanac/config.toml
- Prompt-forbidden files:
- runtime state,
- app source files,
- logs,
- unrelated repo files.
Files:
src/codealmanac/services/config/src/codealmanac/services/setup/src/codealmanac/workflows/page_run/- lifecycle prompt/context builders under
src/codealmanac/prompts/ tests/test_ingest_workflow.pytests/test_cli.py
Verification:
- Test enabled config renders commit-allowed prompt context.
- Test disabled config renders do-not-commit prompt context.
- Test no CodeAlmanac Git committer/staging integration exists.
uv run pytest tests/test_ingest_workflow.py tests/test_cli.py
Goal: keep CodeAlmanac updated automatically through its own automation task.
Todos:
- Add an
updateautomation task. - Install it by default during setup.
- Run it as a separate scheduled job, not inside sync or Garden.
- Add a global update lock under
~/.codealmanac/. - Skip update if another CodeAlmanac job is active.
- Support uv tool installs and pip installs.
- Skip editable/source installs.
- Log updater output under
~/.codealmanac/logs/. - Run a post-update smoke:
codealmanac --version- quick doctor/check command
Files:
src/codealmanac/services/automation/src/codealmanac/services/updates/src/codealmanac/integrations/automation/src/codealmanac/cli/parser/updates.pytests/test_automation_service.pytests/test_cli.py
Verification:
- Test setup installs update automation.
- Test uninstall removes update automation.
- Test editable installs skip auto-update.
uv run pytest tests/test_automation_service.py tests/test_cli.py
Goal: codealmanac uninstall fully removes CodeAlmanac-owned machine artifacts.
Todos:
- Remove global agent instructions.
- Remove sync, Garden, and update automation.
- Remove
~/.codealmanac/global state. - Remove installed binary/tool when the install method supports it.
- Do not delete repo
almanac/. - Remove
--target,--keep-automation,--keep-instructions, and any other partial-uninstall flags. - Keep a non-destructive confirmation path for interactive terminals.
- Keep
--yesnon-interactive.
Files:
src/codealmanac/services/setup/src/codealmanac/services/updates/src/codealmanac/integrations/setup/src/codealmanac/integrations/automation/tests/test_setup_service.pytests/test_cli.py
Verification:
- Test uninstall removes instructions.
- Test uninstall removes all automation tasks.
- Test uninstall removes
~/.codealmanac/. - Test uninstall does not delete repo
almanac/. uv run pytest tests/test_setup_service.py tests/test_cli.py
Goal: bring back the archive onboarding experience in the Python CLI.
Todos:
- Port the archive setup feel:
- banner,
- badge,
- step markers,
- interactive questions,
- next-steps box.
- Keep Python implementation patterns.
- Remove hosted/self-managed split.
- New setup flow:
[1/4] Agent instructions,[2/4] Wiki maintenance,[3/4] Product updates,[4/4] Agent change handling,- final next step:
cd /path/to/your/repothencodealmanac init.
- Every interactive setup choice uses a left/right or equivalent directional
visual surface, with a visible
[n/4]progress marker. - The agent change handling screen previews the literal consequence of each
choice:
- commit mode shows a small git log with a new
almanac: ...commit, - worktree mode shows a simplified VS Code-style diff list with file paths
and
-N +Ncounts.
- commit mode shows a small git log with a new
- Approved agent change handling mock:
◆ [4/4] Agent change handling
Should agents commit wiki changes or leave them in the worktree?
┌────────────────────────────────────┐ ┌────────────────────────────────────┐
│ Commit changes │ │ Leave in worktree │
│ │ │ │
│ ● almanac: update wiki context │ │ almanac/architecture/indexing.md │
│ │ rohan · just now │ │ -18 +42 │
│ │ │ │ almanac/decisions/local-first.md │
│ ● docs: previous repo commit │ │ -4 +19 │
│ │ rohan · earlier │ │ almanac/guides/setup.md │
│ │ │ -2 +11 │
└────────────────────────────────────┘ └────────────────────────────────────┘
selected
[←/→] switch [enter] choose
- When worktree mode is selected, the same screen moves the selected indicator under the diff card.
- The implementation should color the selected border/indicator, dim the unselected card, color diff counts red/green, and keep the commit preview legible.
- The mental model is:
- commit mode means the user sees a clean
almanac: ...commit, - worktree mode means the user sees modified files and diff counts.
- commit mode means the user sees a clean
codealmanac setupis computer-level onboarding. It must not initialize, detect, register, or mutate a repoalmanac/tree.- Support
--yes. - Support non-TTY behavior.
- Keep JSON output for scripts.
Archive reference files:
archive/code/src/cli/commands/setup/output.tsarchive/code/src/cli/commands/setup/index.tsarchive/code/src/cli/commands/setup/setup-plan.tsarchive/code/src/cli/commands/setup/auto-update-step.tsarchive/code/src/cli/commands/setup/auto-commit-step.ts
Python target files:
src/codealmanac/cli/render/setup.pysrc/codealmanac/services/setup/tests/test_setup_service.pytests/test_cli.py
Verification:
- Snapshot-style tests for setup output.
- Tests for
--yes. - Tests for JSON output.
- Tests for idempotent rerun.
uv run pytest tests/test_setup_service.py tests/test_cli.py
Goal: make codealmanac init delegate to a model-backed internal build
operation and make build, ingest, and garden the only internal wiki
operations.
Non-negotiables:
codealmanac initis public.codealmanac buildis not public.- run records use only
build,ingest, orgarden. synccreatesingestruns and is not a run operation.updateis product maintenance and is not a wiki operation.captureis retired language.- Kushagra's prompt/manual material from commit
4c615718is copied literally first and adapted only for Python/nestedalmanac/format.
Todos:
- Port Kushagra's July init prompt from
4c615718into the Python package assrc/codealmanac/prompts/operations/build.md. - Preserve Kushagra's writing-subagent, coverage-map, topics, and article quality instructions.
- Adapt only the current product facts:
initas public command,buildas internal operation,almanac/as the only repo wiki root, browseable nested Markdown pages, Markdown links,sources:evidence, and three operation names. - Make
codealmanac initcreate/registeralmanac/, start abuildrun, invoke the lifecycle harness, validate mutations underalmanac/, refresh the index, and validate wiki health. - Keep deterministic scaffold/index work private to services. It is not a public operation.
- Remove
RunOperation.SYNC. - Keep
syncas transcript intake that startsingestruns. - Keep setup next steps focused on navigating to a repo and running
codealmanac init. - Test that
initrecords operationbuild. - Test that
codealmanac buildis rejected by the parser. - Test that sync-created runs record operation
ingest.
Files:
src/codealmanac/cli/dispatch/build.pysrc/codealmanac/cli/parser/lifecycle.pysrc/codealmanac/services/runs/models.pysrc/codealmanac/workflows/build/src/codealmanac/workflows/run_queue/src/codealmanac/workflows/sync/src/codealmanac/prompts/operations/build.mdsrc/codealmanac/manual/tests/test_build_workflow.pytests/test_cli.pytests/test_sync_workflow.pytests/test_public_contract.py
Verification:
uv run pytest tests/test_build_workflow.py tests/test_cli.py tests/test_sync_workflow.py tests/test_public_contract.pyuv run ruff check .
Goal: make the viewer match the new almanac/ tree.
Todos:
- Keep Alpine-inspired visual style.
- Replace flat page list as the primary experience with folder browsing.
- Show nested folders and pages.
- Show page path in header.
- Render Markdown links as internal page navigation.
- Show sources panel.
- Show backlinks derived from Markdown links.
- Keep search and topics as alternate entry points.
- Remove jobs/runtime assumptions tied to repo-local
almanac/jobs/.
Files:
src/codealmanac/server/assets/app.csssrc/codealmanac/server/assets/viewer/src/codealmanac/services/viewer/tests/test_viewer_service.pytests/test_viewer_ui_assets.py
Verification:
- Service tests for folder tree DTOs.
- UI asset tests for route helpers.
- Browser/manual smoke after dev server starts.
uv run pytest tests/test_viewer_service.py tests/test_viewer_ui_assets.py
Goal: prove the rebuilt local product is coherent.
Todos:
- Remove obsolete compatibility code.
- Remove hosted/cloud leftovers.
- Remove
pages/,files:,slug:, and wikilink assumptions. - Update docs and tests.
- Run full test suite.
- Run lint.
- Run a local smoke:
- setup,
- init,
- ingest,
- validate,
- search,
- show,
- serve,
- uninstall.
Verification:
uv run ruff check .
uv run pytestManual smoke leaves:
repo/almanac/ # clean committed wiki source
~/.codealmanac/repos/<repo-id> # derived runtime state