Skip to content

Link deployed review file paths to GitHub files#70

Merged
BunsDev merged 4 commits into
OpenCoven:mainfrom
romgenie:agent/deploy-review-file-links
Jul 9, 2026
Merged

Link deployed review file paths to GitHub files#70
BunsDev merged 4 commits into
OpenCoven:mainfrom
romgenie:agent/deploy-review-file-links

Conversation

@romgenie

@romgenie romgenie commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Update the Python deployment webhook bundle so published review comments link repo-relative file references to GitHub files.

This mirrors the formatter fix from the TypeScript webhook PR and covers the hosted deployment path that was still emitting raw or partial file references in Covencat comments.

Details

  • Linkifies safe inline-code file mentions outside fenced code blocks.
  • Linkifies bare repo-relative file tokens in prose while avoiding existing Markdown links and URLs.
  • Splits command-like code spans so the command stays code and the embedded file path becomes a GitHub link.
  • Pins links to captured review head SHA when available, with workspace/default-branch fallback.
  • Supports GitHub line anchors and line ranges, e.g. #L12 and #L12-L14.
  • Rejects bracketed schema identifiers such as tests_run[].output_summary so they remain plain code.
  • Applies the same link formatting to changed-file evidence, reviewed/supporting file lists, findings, test output summaries, and no-findings rationale.
  • Adds Python regression tests for screenshot-style file lists, structured review files, line anchors/ranges, command spans, bare prose paths, URLs, and non-file identifiers.

Related PRs

Validation

  • python -m unittest deploy.coven-github.test_coven_github_adapter
  • python -m py_compile deploy/coven-github/coven_github_adapter.py
  • CompleteTech staging copy smoke tests passed against .deploy-complete-tech/coven_github_adapter.py.
  • Remote hosted formatter smoke tests passed on complete.tech, including bare prose paths, command spans, line ranges, URLs, and bracketed schema identifiers.
  • Hosted health checks passed for https://webhook.complete.tech/healthz and https://webhook.complete.tech/github/healthz.

Live deployment check

Deployed the patched adapter to the CompleteTech Passenger app and restarted it via webhook/tmp/restart.txt.

Post-deploy Covencat verification succeeded:

The latest comment shows bare Tests/commands considered file refs linked and tests_run[].output_summary left unlinked.

@romgenie romgenie force-pushed the agent/deploy-review-file-links branch from 265deae to a5fa7cf Compare July 8, 2026 19:03
@romgenie romgenie marked this pull request as ready for review July 8, 2026 19:03
@romgenie

romgenie commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

@BunsDev this is ready for review. Related TypeScript webhook source PR: OpenCoven/coven-github-webhook#9. The commit includes the required DCO Signed-off-by trailer, and the CompleteTech hosted deploy has already been smoke-tested and verified by Covencat: OpenCoven/coven-github-webhook#9 (comment)

@romgenie romgenie force-pushed the agent/deploy-review-file-links branch 5 times, most recently from f2c76d2 to ce944e8 Compare July 8, 2026 19:22

@BunsDev BunsDev 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.

Reviewed the formatter path by path — the escaping, fence/existing-link guards, and line anchors are all solid (verified src/a).tssrc/a%29.ts URL-encodes correctly, fenced blocks stay untouched, and docs/demo.md:12-30 anchors to #L12-L30). py_compile + the full unittest suite pass locally.

One high-frequency false positive in the bare-path linkifier, though:

link_github_file_mentions(task, 'Fixed a bug, e.g. the parser broke.')
→ 'Fixed a bug, [`e.g`](https://github.com/OpenCoven/coven-github/blob/feedface/e.g). the parser broke.'

e.g. / i.e. match bare_path_pattern (extension g/e), so almost every prose summary will publish a dead blob/<sha>/e.g link. Dotted identifiers like foo.bar.baz.qux linkify too.

Suggested fix, either works:

  1. In link_bare_github_file_mentions, only linkify bare (non-backticked) mentions that contain at least one / — single-segment names stay prose unless the author backticks them; or
  2. Cross-check single-segment bare paths against review_evidence.changed_files / reviewed_files before linking.

Backticked mentions (inline_code_with_github_file_links) can keep the current permissive behavior — the author already marked those as code. A regression test for e.g./i.e. staying unlinked would lock it in.

Signed-off-by: Timothy Wayne Gregg <Timothy.Gregg@complete.tech>
@romgenie romgenie force-pushed the agent/deploy-review-file-links branch from ce944e8 to cbeee32 Compare July 8, 2026 20:56
@romgenie

romgenie commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

@BunsDev addressed the requested bare-path false-positive issue. Bare prose linking now avoids abbreviations/dotted identifiers like \e.g., \i.e., and \ oo.bar.baz.qux; bare single-segment paths only link when they are known review/evidence files, while backticked file mentions keep the permissive behavior you called out.\n\nValidation run:\n-
pm test\ and
pm run build\ on OpenCoven/coven-github-webhook#9\n- \python -m unittest deploy.coven-github.test_coven_github_adapter\n- \python -m py_compile deploy/coven-github/coven_github_adapter.py\n- CompleteTech hosted adapter redeployed/restarted and remote smoke-tested for \e.g., \i.e., dotted identifiers, known root files, and slash paths\n\nUpdated PR head: \cbeee3288d9ee65c9583c4f4dd7095ea4ddf3e55.

@romgenie

romgenie commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

@BunsDev GitHub would not let this account submit a formal re-review request, but the requested false-positive fix is pushed and deployed. Please re-review when you have a chance.

@romgenie romgenie requested a review from BunsDev July 8, 2026 21:01

@BunsDev BunsDev 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.

Re-reviewed the pushed fix — the bare-path false positives are resolved. Verified locally on the PR head: e.g./i.e. and dotted identifiers (foo.bar.baz.qux) stay prose, single-segment bare paths only link when present in review_evidence.changed_files/reviewed files, multi-segment paths and line anchors (src/main.rs:12-30#L12-L30) still link correctly, and backticked mentions keep the permissive path. py_compile + full unittest suite pass, and the regression test locks in the abbreviation cases. DCO sign-off present. Thanks for the quick turnaround!

@BunsDev BunsDev merged commit 29fc27c into OpenCoven:main Jul 9, 2026
1 check passed

@BunsDev BunsDev 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.

Reviewed the diff, ran the suite locally (py_compile + unittest discover, 5/5 pass), and probed the formatter with adversarial inputs beyond the test cases. CI is green.

What holds up well:

  • Existing markdown links are protected from double-linking (verified: [existing](url) untouched while adjacent bare paths still link)
  • ../ traversal, absolute paths, drive letters, and scheme-prefixed tokens all correctly rejected
  • Bracketed schema identifiers (tests_run[].output_summary) and dotted prose (e.g., foo.bar.baz) stay plain
  • Path segments are percent-encoded with safe="" and the repo slug is validated before building blob URLs
  • Head-SHA pinning with workspace/default-branch fallback is the right precedence

Non-blocking observations:

  1. An unclosed fence (e.g. from a truncated summary) is treated as prose, so paths inside it get linkified and render as literal markup inside the code block on GitHub. Cosmetic, rare.
  2. Extension-less files (Makefile, Dockerfile, LICENSE) never link due to the extension requirement — reasonable trade-off against false positives, just noting it.
  3. Reversed ranges (:14-12) silently anchor to #L14 only — sensible degradation.

Nice mirroring of the TS formatter fix onto the hosted path, and the regression tests are thorough. LGTM.

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.

2 participants