Reconcile external_directory and pass every declaration to the reconciler - #326
Merged
Conversation
…conciler (#316) Fresh installs go through runtime_generate_config; every existing install goes through the additive reconciler instead. The reconciler owned permission.edit only, so the upgrade path silently diverged from a fresh install in two ways: - an engineering->managed upgrade kept the stale DMC workspace grant, which is the drift #314 existed to eliminate (removed by hand on h44 at the time) - --managed-writable and --log-path were never passed to it at all, so on the first real log grant the declarations landed in neither external_directory nor edit expected_external_directory now owns the managed grants the same way expected_edit_permission owns the edit rules: absolute and ~ paths are wp-coding-agents' to write and remove, relative entries are the operator's and are preserved. The workspace dir arrives via --workspace-dir so the reconciler can add it under engineering and drop it under managed. Verified against the upgrade path, not just generation, since that is the one every real install takes.
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.
Closes #316.
Fresh installs go through
runtime_generate_config. Every existing install goes through_runtime_repair_opencode_json_additiveinstead — and that path only reconciledpermission.edit. So the upgrade path silently diverged from a fresh install in two ways:1. Stale workspace grant. An engineering→managed upgrade kept
"/var/lib/datamachine/workspace/**": "allow"— a grant to a directory that is empty by design on managed. That is exactly the drift #314 set out to eliminate; I removed it by hand on h44 at the time rather than fixing the cause.2. New declarations never arrived.
--managed-writableand--log-pathwere added to the Python helper's argparse but never passed from bash. Applying the first real log grant to h44 produced:The flags were accepted, recorded as options, reflected in AGENTS.md, and had no effect on the permission set.
Fix
expected_external_directoryowns the managed grants the same wayexpected_edit_permissionowns the edit rules:~paths are wp-coding-agents' to write and remove--workspace-dir, so the reconciler adds it under engineering and drops it under managedAnd the bash callers now pass
--managed-writable,--log-path, and--workspace-diralongside--managed-source.Tests
tests/posture.shcovers the reconcile path specifically — stale workspace grant dropped, operator-added grant preserved, and a log path naming a file granted as a literal rather than only as a subtree.That last one matters:
/var/log/php8.5-fpm.log/**matches nothing, which is why #325 emits both forms.Full suite: no new failures (same 7 pre-existing environment failures as
main).