feat: migrate to Core's git-free incremental (#401)#52
Open
Svilen-Stefanov wants to merge 4 commits into
Open
Conversation
Core's content-versioning stack removed the git-ref incremental API: run_full/ run_incremental now take (RunPaths, RunContext), run_incremental drops base_ref/target_ref/source_sha (it diffs a fingerprint.json sidecar against the checkout itself), and metadata.commit_hash is gone. Without this the action TypeErrors on every analysis once #401 lands. engine_adapter.py: - Migrate every run_full/run_incremental call to (RunPaths, RunContext) via a _run_ctx() helper; drop base_ref/target_ref from run_incremental and the head subcommand/argparser. - run_seed also writes fingerprint.json (hash_repo_source_files), the baseline git-free incremental diffs against. - run_analyze (sync): drop the commit_hash trustworthiness gate — a present analysis.json runs incremental (Core self-falls-back to full on a missing sidecar/cache); full only on force_full or no baseline. action.yml (sync mode is naturally git-free — analyze latest, commit back): - Seed the sync workdir from the committed .codeboarding/ directly (analysis.json + fingerprint.json), gated on both files' presence; drop the baseline-SHA worktree seed and the commit_hash lookup. - Commit fingerprint.json back alongside analysis.json + the pkl so the next sync's baseline is self-contained; drop the now-redundant SHA-keyed sync static-analysis cache (the pkl travels via git). - Review mode stays git-based (a PR review compares two commits): its base seed now also emits fingerprint.json; bump the base cache key v2 -> v3. Tests: update engine_adapter/sync stubs for the new Core symbols; rewrite the head/analyze tests for the (RunPaths, RunContext) call shape and the git-free baseline gate. 171 passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Contributor
Architecture review · failedThe architecture diff couldn't be generated for this run. See the workflow logs for details. codeboarding-action · run 29246147062 |
The best-effort engine import degrades every engine symbol to None, so an installed codeboarding package that predates Core #401 (no RunPaths/RunContext) made the analysis subcommands die with a cryptic "'NoneType' object is not callable" deep in _run_ctx. Guard base/seed/head/analyze/render at dispatch with a clear message naming the missing git-free API and the codeboarding_version pin to fix. Metadata-only subcommands, concat, and best-effort health are unaffected. Makes true the module's own claim that these subcommands "fail loudly when these are None". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
TEMPORARY, revert before merge. This PR targets Core's git-free API (#401), which is on Core main but not yet on PyPI, so the pinned codeboarding_version default (0.12.5) can't exercise it. Install the engine from Core main in the dogfood review job so this PR validates the migration end to end. Drop this before merge so the action ships a released version, never a git ref. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
CodeBoarding Core's content-versioning stack (CodeBoarding#401) removed the git-ref incremental API. Once it merges to Core
main, this action breaks:engine_adapter.pycallsrun_full/run_incrementalwith the old signatures (repo_path=/output_dir=/base_ref=/target_ref=/source_sha=), which now raiseTypeError.metadata.commit_hash— which sync mode used to identify its baseline — is also gone.New Core API:
run_full(run_paths: RunPaths, run_context: RunContext, depth_level=, source_sha=)run_incremental(run_paths: RunPaths, run_context: RunContext)— no base/target ref; it diffs a whole-treefingerprint.jsonsidecar against the checkout itself.Changes
engine_adapter.pyrun_full/run_incrementalcall to(RunPaths, RunContext)via a_run_ctx()helper. Dropbase_ref/target_reffromrun_incrementaland from theheadsubcommand + argparser.run_seednow also writesfingerprint.json(hash_repo_source_files) — the baseline git-free incremental diffs against.run_analyze(sync): drop thecommit_hashtrustworthiness gate. A presentanalysis.jsonruns incremental (Core self-falls-back to full on a missing sidecar/cache); full only on--force-fullor no baseline.action.ymlSync mode is naturally git-free ("analyze the latest state, commit the architecture back") — so it no longer needs a baseline SHA or a worktree:
.codeboarding/directly (analysis.json+fingerprint.json), gated on both files' presence. Removed the baseline-SHAgit worktree addseed and thecommit_hashlookup.fingerprint.jsonback alongsideanalysis.json+ the pkl, so the next sync's baseline is self-contained. Dropped the now-redundant SHA-keyed sync static-analysis cache (the pkl travels via git, a more durable cross-runner baseline).Review mode stays git-based — a PR review inherently compares two commits — but its base seed now also emits
fingerprint.json, and the base cache key is bumpedv2 → v3(the cached base dir now includes the sidecar).Tests
Updated the engine_adapter/sync stubs for the new Core symbols (
RunPaths/RunContext/write_fingerprint/hash_repo_source_files) and rewrote thehead/analyzetests for the(RunPaths, RunContext)call shape and the git-free baseline gate. 171 passing.Depends on
github_action.py, Core's own docs.yml entry point — a different file from this action repo).🤖 Generated with Claude Code
Outdated
analysis.jsonmigrationThe action now defaults to CodeBoarding Core 0.13.0. Before attempting an incremental run, it loads the baseline through the installed Core's
UnifiedAnalysisJsonmodel and requires a lossless model round-trip. This detects old or otherwise incompatible formats without hardcoding individual JSON properties.Sync mode
analysis.json, fingerprint, and caches are committed back to the branch.analysis_modeoutput reportsfull; later sync runs return toincremental.Review mode
Review mode does not commit the migrated baseline. The sync job persists it. Therefore no manual migration is required: the first affected run performs the necessary full rebuild, and subsequent runs can be incremental again.