Skip to content

[ECHO] Qualify app deployment eligibility before waiting or recording Sentry - #2099

Merged
swu-echo[bot] merged 8 commits into
mainfrom
echo/um-observer-eligibility-20261127
Nov 27, 2026
Merged

swu-echo[bot] merged 8 commits into
mainfrom
echo/um-observer-eligibility-20261127

Conversation

@jaywedgeworth22

@jaywedgeworth22 jaywedgeworth22 commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds deployment eligibility qualification before production observation and Sentry recording. Workflows now classify whether the live-vs-expected delta is app-relevant and skip waiting/recording for verified non-app deltas, while failing closed to strict observation on any unavailable or unverified evidence.

Changes

  • Added app watch-path policy (production-app-watch-paths.json) and production-observer-eligibility.mjs to verify app identity, auto-deploy and watch-path parity, then compare live health revision against expected SHA via ancestry and first-parent changed paths.
  • Updated production-deploy-verify.yml to load dedicated policy config and gate the exact-revision wait on eligibility output.
  • Updated sentry-deploy.yml to load dedicated policy config and gate live revision verification / Sentry deployment recording on eligibility output.
  • Added production-observer-eligibility.node-test.mjs covering app-relevant paths, non-app deltas, renames, malformed evidence, pattern qualification and policy drift, plus workflow wiring checks. Updated existing Sentry reporter test for the additional eligibility context.

Operational impact

  • Non-app-only changes can result in no deployment wait and no Sentry annotation, with a non-deployment summary. App-relevant or unverified states still require observation and existing strict release verification is unchanged. Behavior when health, history, diff or policy evidence is incomplete remains unverified in production.

Tests

  • Tests added as described above; no test run results, deployment verification, or runtime validation are reported here.

Risks / unresolved review findings

  • Automated review reported 2 unresolved findings: missing variable name in observer-token error handling, and external app policy response used without schema parsing. These remain unaddressed in this summary.

Summary

Qualifies app deployment eligibility before waiting or recording Sentry. It rejects malformed external app policy via strict schema validation and narrows observer credential scope to a dedicated metadata-only reader.

Changes

  • Added zod schema validation for Coolify app policy in production-observer-eligibility.mjs, replacing implicit property checks. Clarified missing-token and policy-read failure errors.
  • Updated sentry-deploy.yml to install dependencies with npm ci --ignore-scripts before running node tests, supporting the new validation dependency.
  • Added node test covering malformed policy inputs to ensure drift is not accepted.
  • Tightened test-oracle-deploy-config.mjs from forbidding all observer secrets to allowing only the approved single-app policy reader in its dedicated path, while continuing to forbid mutation credentials and unsafe SSH.

Tests

  • Tests added but not reported as run: malformed policy schema rejection case and updated oracle deploy-config allowlist checks. Runtime verification remains unverified.

Unresolved risks / Review findings

  • High: new zod import may break dependency-free test step in record job. Medium: unbounded Coolify response buffering before validation. Medium: observer secret allowlist may miss bracket secret access.

Summary

Qualifies app deployment eligibility with stricter policy-response handling before waiting or recording Sentry deploys. Adds bounded, content-type-checked streaming JSON parsing for the app-policy read to reject unavailable, non-JSON, empty, or oversized responses.

Changes

  • Added readPolicyResponse() in production-observer-eligibility.mjs to validate JSON content type, enforce 64KB size bounds during streaming, and fail closed on malformed payloads; classifyProduction() now uses it instead of unbounded response.json().
  • Reordered sentry-deploy.yml record job to run npm ci --ignore-scripts before deployment evidence/reporting tests so zod-backed fixtures have dependencies available.
  • Extended deploy-config oracle to forbid bracket secret access and enforce single approved policy-reader secret scoping for the observer.
  • Added tests covering response type/size validation and install-before-test ordering. Behavior remains unverified in a live deployment.

Tests

  • Added Node tests for readPolicyResponse() rejection/acceptance cases and workflow step ordering. No test-run, deployment, or runtime verification evidence is reported in the changes.

Risks

  • Automated review reported 1 medium finding: test-oracle-deploy-config.mjs:63 notes Sentry deploy workflow skips bracket-secret and single-reader checks. Treat as unresolved.

Summary

Tightens deploy-config oracle checks to enforce exact approved credentials for observer and Sentry deploy reporting. No runtime workflow behavior is changed by this patch.

Changes

Replaces the single observer secret list check with a reusable exact-secrets assertion applied to the observer workflow, Sentry deploy workflow, and record job. Adds negative cases asserting that bracket-style secret access and injected mutation credentials fail validation, while retaining the reporter's existing Sentry credential and blocking hosting mutation access.

Operational impact

Reduces risk of credential scope creep by failing if unauthorized secrets are added to deployment observation or deploy recording. No user-visible deployment eligibility or Sentry reporting change is implemented in this diff.

Testing

Tests added in scripts/test-oracle-deploy-config.mjs only; no test-run evidence, deployment, or runtime verification is provided in the changes, so verification remains unverified.

Unresolved risks

Automated review reported 2 medium findings that remain unresolved: whitespace around dot may bypass secret enumeration and the exact-secrets check may miss the github.token credential. Behavior described here is unverified.


Summary

Tightens the deploy-config test oracle that guards observer and Sentry reporter credential usage. Parsing now evaluates YAML structure so comments and documentation text are not mistaken for secret references, while quoted workflow expressions remain checked.

Changes

  • Added YAML parsing for secret-reference checks to reduce false positives from comments. Expanded rejection of bracket-style and spaced secret access patterns and added coverage for duplicate references and read-only token permissions. Behavior beyond the updated oracle remains unverified in this change set.

Verification and Risk

  • Adds oracle assertions only; no test execution, deployment, or runtime verification is reported. Open automated review finding remains unresolved: secret references in YAML mapping keys may bypass inspection.

Summary

Tightens Oracle deploy-config secret validation to inspect YAML mapping keys as well as values. Adds a test case asserting rejection when an unapproved secret reference appears as a mapping key.

Impact

No runtime or user-visible change. Strengthens the CI guardrail against bypassing the approved-secret allowlist through keys, while continuing to ignore comments and non-expression documentation.

Verification

Test coverage was added in scripts/test-oracle-deploy-config.mjs. No test run, deployment, or runtime verification is evidenced in the provided changes. Automated code review reported no issues in the changes it reviewed.

@kody-ai

This comment has been minimized.

@swu-echo

swu-echo Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@kody start-review

@kody-ai

kody-ai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Automatic approval held

Kody's assessment:

Risk was identified in this PR.

kody-ai[bot]
kody-ai Bot previously requested changes Nov 27, 2026

@kody-ai kody-ai Bot 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.

Found critical issues please review the requested changes

Kody takes this request back once the findings above are resolved.

@kody-ai

This comment has been minimized.

@swu-echo

swu-echo Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@kody start-review

Comment thread scripts/test-oracle-deploy-config.mjs Resolved
@kody-ai
kody-ai Bot dismissed their stale review November 27, 2026 22:43

The critical findings behind this request are resolved.

@kody-ai

This comment has been minimized.

@swu-echo

swu-echo Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@kody start-review

Comment thread scripts/test-oracle-deploy-config.mjs Resolved
@kody-ai

This comment has been minimized.

@swu-echo

swu-echo Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@kody start-review

Comment thread scripts/test-oracle-deploy-config.mjs Resolved
Comment thread scripts/test-oracle-deploy-config.mjs Resolved
Comment thread scripts/test-oracle-deploy-config.mjs Resolved
@kody-ai

This comment has been minimized.

@swu-echo

swu-echo Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@kody start-review

Comment thread scripts/test-oracle-deploy-config.mjs Resolved
@kody-ai

This comment has been minimized.

Comment thread scripts/test-oracle-deploy-config.mjs Resolved
Comment thread scripts/test-oracle-deploy-config.mjs Resolved
@kody-ai

This comment has been minimized.

@swu-echo

swu-echo Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@kody start-review

Comment thread scripts/test-oracle-deploy-config.mjs Resolved
@swu-echo

swu-echo Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@kody start-review

@kody-ai

kody-ai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

@swu-echo
swu-echo Bot merged commit 6eea84e into main Nov 27, 2026
21 checks passed
@swu-echo
swu-echo Bot deleted the echo/um-observer-eligibility-20261127 branch November 27, 2026 23:39
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