Skip to content

docs(issues): add specification for #2175 - #2176

Merged
josecelano merged 12 commits into
torrust:developfrom
da2ce7:merge-tool-symlink-exceptions-spec
Sep 9, 2026
Merged

josecelano merged 12 commits into
torrust:developfrom
da2ce7:merge-tool-symlink-exceptions-spec

Conversation

@da2ce7

@da2ce7 da2ce7 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Spec-only PR: adds the folder-style specification for #2175, explicit symlink exceptions for the vendored maintainer merge tool, under docs/issues/open/2175-merge-tool-symlink-exceptions/ISSUE.md, plus the three dictionary words its text needs. No tool, wrapper, or test changes; implementation follows in a separate PR once this specification is merged.

The specification proposes a root .symlinks.json manifest (shared format namespace com.torrust.repository.symlinks) listing each accepted symbolic link with its exact target and reason; an optional --symlinks <path> argument on github-merge.py naming a tree path inside the final merged tree, with every admitted link printed before sign-off — the argument carries no default inside the tool, so a run without it performs no declaration processing and keeps today's unconditional refusal; and merge-pull-request.sh passing --symlinks .symlinks.json unconditionally, as the single place the repository's declaration path is stated. Three properties carry the design: the manifest is read from the final merged tree only, never from the working directory or any branch; every commit the merge introduces (pull/<n>/base..pull/<n>/head plus the merge commit) is checked against that single manifest, with refusals naming the carrying commit; and targets that are absolute or contain .. are never accepted whatever the manifest says. A consequence the spec states explicitly: removing a declared link is a two-step change, since pre-deletion commits are judged against the final manifest.

The specification also records the resolved architectural decision AD1: the vendored tool becomes an ordinary repository file maintained under normal review, with README-github-merge.md reduced to a single permanent provenance statement (origin, MIT license, original SHA-256, introducing commit 833a416) and no re-hashing, byte-identity, or divergence tracking.

Files touched

  • docs/issues/open/2175-merge-tool-symlink-exceptions/ISSUE.md — the specification (drafted under docs/issues/drafts/, moved to open/ with the issue number per the create-issue skill).
  • project-words.txt — Buildah, containerignore, topo, added with the repository formatter.

Validation

  • linter all (torrust-linting 0.2.0): all linters passed, including markdownlint, lychee local links, and cspell.
  • Every relative link in the specification was recomputed after the move and checked for existence.
  • The technical claims about the tool (refusal path, exit code, availability of the merge commit and the base..head range at the check site) were verified against contrib/dev-tools/git/github-merge.py with cited line numbers.

Related to #2175 (spec-only; implementation follows separately).

Copilot AI lite review requested due to automatic review settings September 8, 2026 17:52
@josecelano josecelano self-assigned this Sep 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Adds a folder-style issue specification for #2175 describing how the vendored maintainer merge tool should support explicit, tree-sourced symlink exceptions, plus cspell dictionary updates needed by the spec text.

Changes:

  • Added new issue spec document under docs/issues/open/2175-merge-tool-symlink-exceptions/.
  • Extended project-words.txt with three new dictionary words used in the spec.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/issues/open/2175-merge-tool-symlink-exceptions/ISSUE.md New spec defining the proposed .symlinks.json manifest, enforcement rules, and implementation/verification plan
project-words.txt Adds Buildah, containerignore, and topo to repository word list

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@josecelano
josecelano self-requested a review September 8, 2026 18:50

@josecelano josecelano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Address Copilot's suggestions by strictly following the process described in the repo.

@da2ce7

da2ce7 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Both Copilot suggestions were processed per process-copilot-suggestions: each thread was assessed (both no-action, verified against the file and the repository template), replied to with the reason, and resolved one at a time; the tracker docs/copilot-pr-reviews/pr-2176-copilot-suggestions.md records thread ids, comment and reply URLs, decisions and states (commit 811308e). No unresolved threads remain; linter all passes on the branch.

@da2ce7
da2ce7 requested a review from josecelano September 8, 2026 19:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

@josecelano josecelano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I found one blocking specification ambiguity that should be resolved before merging:

--symlinks <path> is documented as optional with a default manifest path, which implies that omitting it loads .symlinks.json when present. However, AC8 and the final rule require a run without --symlinks to retain the current behavior of rejecting all symlinks. These contracts conflict.

Please define one behavior and align the rules, implementation plan, automated tests, and manual scenarios:

  • omit the option disables manifest processing, with the wrapper passing the default manifest explicitly; or
  • omit the option loads .symlinks.json, with AC8 revised accordingly.

The specification documented `--symlinks <path>` as optional with a default of `.symlinks.json` while also requiring a run without the argument to keep refusing every symbolic link; both cannot hold, because a default makes the presence of a file in the merged tree decide the outcome. The argument now carries no default value: an omitted `--symlinks` disables declaration processing entirely, so the vendored tool keeps its current behavior for any invocation that does not ask for the new one, and an exemption from a security refusal is visible in the invocation that grants it instead of depending on an invisible fallback path.

The tracker's declaration path is therefore stated once, in the `merge-pull-request.sh` wrapper that already holds repository-specific wiring, and the reasoning is recorded as AD2 and propagated through the scope, ownership review, implementation plan, rules, acceptance criteria, and manual scenarios.
@da2ce7

da2ce7 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

The ambiguity is resolved in favour of the first option: omitting --symlinks disables declaration processing entirely. The argument now carries no default value inside the tool, and a run without it reads no file, admits nothing, reports no accepted or stale entries, and refuses every symbolic link in every checked commit exactly as the tool does today — even when the merged tree happens to contain a .symlinks.json. The repository's chosen path is stated once, in contrib/dev-tools/git/merge-pull-request.sh, which passes --symlinks .symlinks.json unconditionally (unchanged T3/AC9).

Two reasons decided it. The vendored tool keeps its current behaviour for any invocation that does not ask for the new one, so the diff against the file we vendored stays small and reviewable and the single provenance statement in AD1 stays honest about how far the copy has moved. And an exemption from a security refusal should be visible in the invocation that grants it: a built-in default would make the difference between "every link refused" and "these links admitted" depend on whether a file happens to be present in the tree, which is the invisible condition an exception mechanism should not have.

This supersedes the wording in the earlier (now resolved) thread on the Rules section, which described .symlinks.json as the default when the argument is omitted. It is now a repository convention supplied by the caller, not a fallback inside the tool.

Commit: a6eaf7e

Sections aligned in that commit:

  • Scope — the --symlinks bullet states the no-default behaviour; the declaration-file bullet marks .symlinks.json as a caller-supplied convention; the wrapper bullet says the path is stated in exactly one visible place.
  • Architectural Decisions — new AD2 - The declaration path has no default inside the tool (RESOLVED), recording both candidate behaviours, the choice, the three properties that decide it, and the cost (an adopting repository must add the argument to its own wrapper).
  • Design and Ownership Review — github-merge.py never chooses a declaration path; merge-pull-request.sh is the only place the tracker's path is stated.
  • Implementation Plan — T2 takes a path with no default so absence is distinguishable and skips processing when absent; T3 notes the wrapper line is the only statement of the path; T4 adds the "declaration committed in the merged result while the tool runs without --symlinks" test case; T6 adds the wrapper argument to what the merge skill must explain.
  • Rules — the read rule and the argument rule drop the default; the final rule is split into two, one for "argument given, no file at that path" and one for "no argument at all".
  • Acceptance Criteria — AC2 and AC4 drop the default; AC8 now covers both cases in a single entry, so AC1-AC10 numbering and the evidence table are unchanged.
  • Manual scenarios — M4 is now purely the "no manifest in the merged tree, run through the wrapper" case; new M8 covers "manifest present in the merged tree, tool run without --symlinks"; a note records that every scenario except M8 passes the argument. M5-M7 keep their numbers.
  • Risks — the first mitigation now leads with the mechanism being opt-in per invocation.
  • Background and Progress Log — the no-op statement covers invocations that name no declaration, and a dated entry records this change against this review.

linter all exits 0 on the branch tip.

@da2ce7
da2ce7 requested a review from josecelano September 9, 2026 08:22
@josecelano

Copy link
Copy Markdown
Member

One follow-up before I can approve: please update the PR description. It still says --symlinks <path> defaults to .symlinks.json, which contradicts the resolved contract in the specification: omitting the option disables declaration processing, and the wrapper explicitly passes --symlinks .symlinks.json.

@da2ce7

da2ce7 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

PR description updated to the resolved contract: --symlinks <path> carries no default inside the tool, a run without it performs no declaration processing and keeps today's unconditional refusal, and merge-pull-request.sh passes --symlinks .symlinks.json unconditionally as the single place the path is stated. The branch is unchanged at a6eaf7e; the description now matches AD2 and the rules in the specification.

@josecelano josecelano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Confirmed: the PR description now matches the resolved contract. Approved.

@josecelano

Copy link
Copy Markdown
Member

ACK a6eaf7e

@josecelano
josecelano merged commit 696a173 into torrust:develop Sep 9, 2026
1 check passed
@da2ce7
da2ce7 deleted the merge-tool-symlink-exceptions-spec branch September 10, 2026 09:25
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.

3 participants