Skip to content

chore: declutter repo, and fix the documented pandas API - #14

Merged
OmerBaddour merged 4 commits into
mainfrom
worktree-declutter_repo
Aug 1, 2026
Merged

chore: declutter repo, and fix the documented pandas API#14
OmerBaddour merged 4 commits into
mainfrom
worktree-declutter_repo

Conversation

@OmerBaddour

@OmerBaddour OmerBaddour commented Aug 1, 2026

Copy link
Copy Markdown
Member

Two things: a cleanup, and a public-facing docs bug the cleanup uncovered.

1. Decluttering

Path Why removed
.claude/agents/, .claude/agent-memory/ The multi-agent layer was never useful, and its memory had rotted — it pointed at src/clair/auth/environments.py, which does not exist (real path: src/clair/environments/).
.claude/specs/pandas_trouve*.md 822 lines describing an abandoned design (see below).
docs/ PRD + architecture for clair docs, a shipped feature. Its logo was byte-identical to the site_docs copy.
specs/environments.md Feature shipped; site_docs documents it.

Renamed site-docssite_docs per the underscore convention (workflow, .gitignore, README updated). Markdown filenames keep hyphens — they are public URL slugs.

2. Memory, rearchitected

.claude/memory/ now holds only what documentation cannot: project_design_invariants.md (seven rules, each re-verified against code) and project_docs_are_the_source_of_truth.md. Routing-collision and environments notes dropped as duplication of guides/routing.md and concepts/environments.md.

CLAUDE.md gains a "What clair is" section, a package-level map of src/clair/, and a 3-step opening move for feature requests (grep site_docs → read MEMORY.md → open only the named files). One line per package, so it stays true as files move.

3. The pandas API was documented wrong

PandasTrouve does not exist. from clair import PandasTrouve raises ImportError — and README.md is the PyPI long description, so the first code block on the package page was broken.

The real API is a df_fn on the ordinary Trouve, with dependencies declared as parameter defaults:

def daily_event_counts(
    refined_events: pd.DataFrame = upstream,  # type: ignore
) -> pd.DataFrame: ...

trouve = Trouve(df_fn=daily_event_counts)

The docs were written from the design spec, whose two headline decisions — separate class and inputs dict — were both reversed during implementation. The result was self-contradictory docs:

Surface Documented Correct?
reference/trouve-api.md, concepts/trouve.md df_fn
guides/pandas-native.md (12×), index.md, README.md (5×) PandasTrouve

All now use df_fn. Three further claims corrected against real output from example_projects/example_4:

  • compile writes a .py artifact, not a .json manifest
  • clair dag renders roots down to dependents (the old example had the arrows backwards) and tags nodes [PANDAS]
  • there is no clair[pandas] extra — pandas is a hard dependency

This also disproved a claim I had written into the new memory note ("CI publishes the docs, so they stay correct"). mkdocs does not execute examples. The note now states that the code is the final authority.

Checks

  • uv run pytest tests/ — 516 passed (no code changed)
  • uv run --group docs mkdocs build --strict — clean, no broken links
  • clair compile and clair dag run against example_projects/example_4 to verify every documented claim
  • No PandasTrouve reference remains in README.md or site_docs/

🤖 Generated with Claude Code

OmerBaddour and others added 4 commits August 1, 2026 18:16
Remove the unused agent layer and the stale design documents, then point
memory at site_docs as the source of truth for behaviour.

Deleted:
- .claude/agents/ and .claude/agent-memory/ — the multi-agent setup was
  never useful, and its memory had rotted (it sent readers to
  src/clair/auth/environments.py, a path that does not exist).
- .claude/specs/pandas_trouve*.md — 822 lines of design for a feature
  that has no code.
- docs/ — PRD and architecture for `clair docs`, which shipped. The logo
  was a byte-identical copy of the one in site_docs.
- specs/environments.md — the feature shipped; site_docs documents it.

Renamed site-docs -> site_docs, per the underscore directory convention.

Memory now holds only what the documentation cannot: the design
invariants and user corrections. CLAUDE.md gains a package map and tells
a new session to grep site_docs before it reads src.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The README is the PyPI long description. A relative image path does not
resolve there, so the logo was broken on the package page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The guide, landing page and README documented `PandasTrouve(inputs={},
transform=)`. That class does not exist. `from clair import PandasTrouve`
raises ImportError, and README.md is the PyPI long description, so the
first code block on the package page was broken.

The real API is a `df_fn` on the normal Trouve. Dependencies are the
parameter defaults:

    def daily_event_counts(
        refined_events: pd.DataFrame = upstream,  # type: ignore
    ) -> pd.DataFrame: ...

    trouve = Trouve(df_fn=daily_event_counts)

The docs were written from an early design spec whose two main decisions
-- a separate class, and an `inputs` dict -- were both reversed during
implementation. The API reference already described `df_fn` correctly, so
the docs contradicted themselves.

Also corrected against real output from example_projects/example_4:
- compile writes a .py artifact, not a .json manifest
- `clair dag` renders roots down to dependents, and tags [PANDAS]
- there is no `clair[pandas]` extra; pandas is a hard dependency

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The pandas guide disproved it. mkdocs does not execute examples, so a
wrong code block ships. The note now says the code is the final
authority, and that you should search for field names, not only class
names.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@OmerBaddour OmerBaddour changed the title chore: declutter agent scaffolding, stale docs, and specs chore: declutter repo, and fix the documented pandas API Aug 1, 2026
@OmerBaddour
OmerBaddour marked this pull request as ready for review August 1, 2026 22:46
@OmerBaddour
OmerBaddour merged commit 3ff000a into main Aug 1, 2026
3 checks passed
@OmerBaddour
OmerBaddour deleted the worktree-declutter_repo branch August 1, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant