feat: publish_service tool for public API deployment#48
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7c2dccf1f5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const record of existingRecords.filter((r) => r.host === fqdn)) { | ||
| await cf.deleteRecord(zoneId, record.id); | ||
| } | ||
| const proxied = args.proxied === true; | ||
| const record = await cf.addRecord(zoneId, "A", fqdn, originIp, 1, proxied); |
There was a problem hiding this comment.
Move DNS cutover after successful publish checks
This updates DNS before the Caddy config/reload and healthcheck run, so any failure in ctx.conway.exec(...) leaves the old record deleted and the hostname pointed at an unverified backend. In practice, a bad Caddy reload or a down local service will return an error but still cause immediate downtime for an already-live subdomain because there is no rollback path after the DNS mutation.
Useful? React with 👍 / 👎.
| await cf.deleteRecord(zoneId, record.id); | ||
| } | ||
| const proxied = args.proxied === true; | ||
| const record = await cf.addRecord(zoneId, "A", fqdn, originIp, 1, proxied); |
There was a problem hiding this comment.
Honor proxied flag when creating Cloudflare records
The tool accepts proxied and even reports (proxied) on success, but this call passes the flag to addRecord even though the provider implementation only sends type/name/content/ttl to Cloudflare, so the proxy mode is never actually set. That means operators can believe traffic is behind Cloudflare when the record is still DNS-only.
Useful? React with 👍 / 👎.
| if (/\b(?:localhost|127\.0\.0\.1)\b/i.test(combined)) { | ||
| return false; |
There was a problem hiding this comment.
Allow public evidence even when local checks are reported
This guard rejects completion as soon as localhost or 127.0.0.1 appears anywhere in output/artifacts, even if the same evidence includes a valid public HTTPS route check. That blocks legitimate completion reports that include both local smoke-test output and public verification, which is a common deployment workflow for these tasks.
Useful? React with 👍 / 👎.
- New publish_service tool for publishing local services to compintel.co subdomains - Handles DNS configuration via Cloudflare and Caddy reverse proxy setup - Validates domain whitelist, subdomain normalization, health checks - Integrates with OPERATIONAL.md publication authority standards - System prompt updates to guide agent on public service publishing This tool enables production deployment of public APIs without requiring shell backgrounding or manual infrastructure setup.
7c2dccf to
4371124
Compare
Public service publishing for compintel.co subdomains
Status: ✅ Code review PASSED
Blockers: NONE