Skip to content

fix(config): resolve PROJECT_ROOT to the checkout when no .env exists (#13572, #13149) - #13646

Merged
mrveiss merged 3 commits into
Dev_new_guifrom
issue-13572-resolver
Aug 5, 2026
Merged

mrveiss merged 3 commits into
Dev_new_guifrom
issue-13572-resolver

Conversation

@mrveiss

@mrveiss mrveiss commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Thinking Path

This is the last remaining failure on the base branch. Run 31014724462 on 30ed84612 has 5 shards green and exactly one red, with LEAK lines: 0, FIXED lines: 0 and a single failing test:

FAILED autobot_shared/ssot_config_test.py::TestProjectRoot::test_project_root_exists
AssertionError: assert False
 +  where False = PosixPath('/opt/autobot').exists

_find_project_root() walks up for a .env and, finding none, returns the packaged install location. .env is git-ignored, so every fresh clone, container build and CI job takes that branch and sets PROJECT_ROOT to a directory that does not exist there. That also points the ~20 env_file=str(PROJECT_ROOT / ".env") declarations in this module at production configuration from a source tree.

This is why it could not land before. Nineteen JSON-Schema defaults derived from PROJECT_ROOT, so correcting the resolver made the published contract carry the runner's checkout path and turned verify-generated-types red — it was implemented, verified, and then reverted. #13572 converted those to factories, so the contract no longer moves when PROJECT_ROOT does. That is what unblocks this.

What Changed

A checkout-root step between the .env walk and the install fallback. The .env walk is untouched and still first: a configured deployment stays authoritative.

Detection requires both .git and autobot_shared at the same directory. Either alone is insufficient — .git alone would match an unrelated repository this package had been vendored into, and autobot_shared alone matches ordinary parent directories in some layouts.

.git is tested with exists(), not is_dir(). In a git worktree it is a file pointing at the real git directory, and this repository's entire workflow runs from worktrees, so an is_dir() check would have excluded every one of them.

Verification

The gate that forced the previous revert now passes with the resolver corrected — this is the evidence that the two changes compose:

scripts/check_openapi_absolute_defaults.py   ->  exit 0
40 passed   # autobot_shared/ssot_config_test.py (36 existing + 4 new)

Marker logic checked against all four shapes rather than the happy path only:

worktree-style .git file    -> True
normal .git directory       -> True
.git without autobot_shared -> False
autobot_shared without .git -> False

autobot_shared/ as a whole has a pre-existing collection error in auth/test_slm_permission_parity.py (TypeError: metaclass…). Confirmed identical on Dev_new_gui with none of these changes, so it is excluded from the figure above rather than attributed here.

Refs #13572, #13149

Model Used

Claude Opus 5

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

Applied Black, isort, and autoflake to match code-quality checks.
Triggered by workflow auto-fix-formatting.yml.
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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