Skip to content

refactor: migrate to modern Python project structure with uv#1

Merged
xzAscC merged 6 commits into
mainfrom
fresh-start
Mar 19, 2026
Merged

refactor: migrate to modern Python project structure with uv#1
xzAscC merged 6 commits into
mainfrom
fresh-start

Conversation

@xzAscC

@xzAscC xzAscC commented Mar 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Migrate from requirements.txt to pyproject.toml with uv package manager
  • Restructure source code into src/probing_reflection/ package
  • Add core type definitions: ProbingConfig, ReflectionResult, ContrastivePair
  • Add comprehensive documentation (AGENTS.md, ARCHITECTURE.md, SPEC.md)
  • Add test infrastructure with pytest
  • Add development scripts (quick_test.sh, full_test.sh)
  • Add experiment draft notes

Changes

Added

  • src/probing_reflection/ - Main package with type definitions
  • pyproject.toml - Modern Python packaging with uv
  • tests/ - Test infrastructure with pytest
  • scripts/ - Development test scripts
    • quick_test.sh - Fast validation with small model
    • full_test.sh - Complete validation across all models
  • .sisyphus/drafts/ - Experiment draft notes
  • .github/ - Issue templates, PR template, CI workflow
  • docs/ - Quality score tracking and design docs

Removed

  • Legacy scripts and placeholder files
  • Old requirements.txt (replaced by pyproject.toml)
  • Legacy source files (acc_length_rel.py, inference.py, etc.)

Verification

uv sync                  # ✅ Dependencies installed
uv run ruff check src/   # ✅ No lint errors
uv run ruff format src/  # ✅ Formatted
uv run mypy src/         # ✅ Type check passed
uv run pytest            # ✅ Tests pass

Commits

Commit Description
73c09bd refactor: migrate to modern Python project structure with uv
80c246a chore: add development test scripts
391b00d docs: add experiment draft for token probing

xzAscC and others added 3 commits March 15, 2026 00:39
- Migrate from requirements.txt to pyproject.toml with uv package manager
- Restructure source code into src/probing_reflection/ package
- Add comprehensive documentation (AGENTS.md, ARCHITECTURE.md, SPEC.md)
- Add test infrastructure with pytest
- Add .github/ for CI/CD configurations
- Simplify .gitignore for Python/IDE patterns
- Remove legacy scripts and placeholder files
Add quick_test.sh and full_test.sh for running validation checks

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add draft notes for token probe experiment requirements and questions

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 issues found across 34 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/probing_reflection/types.py">

<violation number="1" location="src/probing_reflection/types.py:42">
P2: The `metadata` dict is mutable despite the class being documented as immutable. `frozen=True` only prevents field reassignment, not in-place mutation of the dict contents. Use `MappingProxyType` or accept an immutable mapping type to enforce true immutability, matching the class's contract.</violation>
</file>

<file name="TEMPLATE.md">

<violation number="1" location="TEMPLATE.md:38">
P2: Package name in rename instructions (`ai_research_template`) doesn't match the actual package name (`probing_reflection`). Users following these steps will get "file not found" errors from both the `sed` and `mv` commands.</violation>

<violation number="2" location="TEMPLATE.md:71">
P2: Wrong file referenced: `packages = ["YOUR_PROJECT_NAME"]` is in `pyproject.toml` line 35, not `AGENTS.md`. This will send users to the wrong file.</violation>
</file>

<file name="SPEC.md">

<violation number="1" location="SPEC.md:23">
P2: `.sisyphus/plans/` and `.sisyphus/roadmap.md` are nested under the `docs/` bullet as if they live inside that directory, but their paths start with `.sisyphus/`, placing them at the repo root. This contradicts AGENTS.md §10 and will mislead agents about where to find these files. Move them to their own top-level bullets.</violation>
</file>

<file name="AGENTS.md">

<violation number="1" location="AGENTS.md:56">
P2: `unknown` is a TypeScript type that does not exist in Python. An agent following this guideline would write invalid code. The Python equivalents to avoid `Any` are `object`, generic type variables (`TypeVar`/`T`), or `Protocol` types.</violation>

<violation number="2" location="AGENTS.md:58">
P2: Python uses `raise`, not `throw`. This is JavaScript/Java terminology that doesn't apply to this Python project.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread src/probing_reflection/types.py Outdated
Comment thread TEMPLATE.md Outdated
Comment thread TEMPLATE.md Outdated
Comment thread SPEC.md
Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="scripts/full_test.sh">

<violation number="1" location="scripts/full_test.sh:17">
P3: Step counter is wrong: the first four steps say `/4` but there are 5 steps total. The denominator should be `5` throughout.</violation>
</file>

<file name="scripts/quick_test.sh">

<violation number="1" location="scripts/quick_test.sh:17">
P2: Step counter is wrong: there are 5 steps but the first four say `/4`. Update all labels to `/5`.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread scripts/quick_test.sh Outdated
Comment thread scripts/full_test.sh Outdated
xzAscC and others added 2 commits March 18, 2026 23:21
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
xzAscC added a commit that referenced this pull request Mar 19, 2026
Fixes 8 issues identified by automated code review:
- types.py: Use MappingProxyType for immutable metadata in frozen dataclass
- AGENTS.md: Replace TypeScript terminology (unknown) with Python equivalents
- AGENTS.md: Replace Throw with Raise, errors with exceptions
- TEMPLATE.md: Correct package name from ai_research_template to probing_reflection
- TEMPLATE.md: Fix file reference from AGENTS.md to pyproject.toml
- SPEC.md: Move .sisyphus/ to top-level (not nested under docs/)
- scripts/*.sh: Fix step counters from /4 to /5
Fixes 8 issues identified by automated code review:
- types.py: Use MappingProxyType for immutable metadata in frozen dataclass
- AGENTS.md: Replace TypeScript terminology (unknown) with Python equivalents
- AGENTS.md: Replace Throw with Raise, errors with exceptions
- TEMPLATE.md: Correct package name from ai_research_template to probing_reflection
- TEMPLATE.md: Fix file reference from AGENTS.md to pyproject.toml
- SPEC.md: Move .sisyphus/ to top-level (not nested under docs/)
- scripts/*.sh: Fix step counters from /4 to /5
@xzAscC

xzAscC commented Mar 19, 2026

Copy link
Copy Markdown
Owner Author

@codex I Please re-run review. All 8 issues identified have been fixed in commit 44579c3.

@cubic-dev-ai

cubic-dev-ai Bot commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai Please re-run review. All 8 issues identified have been fixed in commit 44579c3.

@xzAscC I have started the AI code review. It will take a few minutes to complete.

@xzAscC xzAscC merged commit 73543b7 into main Mar 19, 2026
1 of 2 checks passed
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