Skip to content

feat: resolve health status handling, contract validation discovery, … - #1283

Merged
Mimah97 merged 1 commit into
Vatix-Protocol:mainfrom
Creed1759:feat/issues-1200-1201-1202-1203
Oct 17, 2026
Merged

Mimah97 merged 1 commit into
Vatix-Protocol:mainfrom
Creed1759:feat/issues-1200-1201-1202-1203

Conversation

@Creed1759

Copy link
Copy Markdown
Contributor

…and correlation id boundary specs

Closes #1203, Closes #1200, Closes #1202, Closes #1201

#1203 — apps/api: AppService.getHealth degraded branch returns 503 and is asserted in controller tests

  • Updated AppController.health to return HTTP 503 (SERVICE_UNAVAILABLE) when AppService.getHealth reports a degraded status and HTTP 200 (OK) when healthy, enabling load balancers and uptime monitors to accurately detect dependency degradation.
  • Added explicit unit tests in apps/api/src/app.controller.spec.ts asserting both HTTP 200 on healthy checks and HTTP 503 on degraded checks.

#1200 — scripts/validate-contracts.js: distinguish missing contract directory from compilation failures

  • Track missing contract directories in a separate missing array distinct from cargo compilation failures (failed).
  • Log explicit failure details with expected directory paths when a contract directory is absent.
  • Report Passed, Missing, and Failed counts separately in the final summary.
  • Guard the --check-drift gate by failing immediately and skipping drift detection when any contract was missing or failed to compile.

#1202 — scripts/validate-contracts.js: dynamically derive contract list from filesystem

  • Replaced the hardcoded contract array with dynamic directory discovery under packages/contract/contracts filtering for valid directories containing Cargo.toml.
  • Merged discovered contracts with expected contracts declared in manifestKeysByContract sorted deterministically.
  • Added a validation check under --check-drift that fails loudly if any discovered contract lacks a mapping in manifestKeysByContract.

#1201 — packages/config: test 64-char boundary and fallback for sanitizeCorrelationId

  • Added comprehensive unit tests in packages/config/scripts/tests/check-shared-config.test.mjs verifying:
    • Valid 64-character correlation ID strings pass through unchanged.
    • Valid 65-character strings are truncated to exactly 64 characters.
    • Empty strings and strings consisting purely of invalid characters return null.
    • resolveCorrelationId({}) defaults to the expected local PID fallback (/^local-\d+$/).

See CONTRIBUTING.md for contribution guidelines and SECURITY.md for reporting security issues.

…and correlation id boundary specs

Closes Vatix-Protocol#1203, Vatix-Protocol#1200, Vatix-Protocol#1202, Vatix-Protocol#1201

## Vatix-Protocol#1203 — apps/api: AppService.getHealth degraded branch returns 503 and is asserted in controller tests
- Updated AppController.health to return HTTP 503 (SERVICE_UNAVAILABLE) when AppService.getHealth reports a degraded status and HTTP 200 (OK) when healthy, enabling load balancers and uptime monitors to accurately detect dependency degradation.
- Added explicit unit tests in apps/api/src/app.controller.spec.ts asserting both HTTP 200 on healthy checks and HTTP 503 on degraded checks.

## Vatix-Protocol#1200 — scripts/validate-contracts.js: distinguish missing contract directory from compilation failures
- Track missing contract directories in a separate missing array distinct from cargo compilation failures (failed).
- Log explicit failure details with expected directory paths when a contract directory is absent.
- Report Passed, Missing, and Failed counts separately in the final summary.
- Guard the --check-drift gate by failing immediately and skipping drift detection when any contract was missing or failed to compile.

## Vatix-Protocol#1202 — scripts/validate-contracts.js: dynamically derive contract list from filesystem
- Replaced the hardcoded contract array with dynamic directory discovery under packages/contract/contracts filtering for valid directories containing Cargo.toml.
- Merged discovered contracts with expected contracts declared in manifestKeysByContract sorted deterministically.
- Added a validation check under --check-drift that fails loudly if any discovered contract lacks a mapping in manifestKeysByContract.

## Vatix-Protocol#1201 — packages/config: test 64-char boundary and fallback for sanitizeCorrelationId
- Added comprehensive unit tests in packages/config/scripts/__tests__/check-shared-config.test.mjs verifying:
  - Valid 64-character correlation ID strings pass through unchanged.
  - Valid 65-character strings are truncated to exactly 64 characters.
  - Empty strings and strings consisting purely of invalid characters return null.
  - resolveCorrelationId({}) defaults to the expected local PID fallback (/^local-\d+$/).
@Mimah97
Mimah97 merged commit 294e7ee into Vatix-Protocol:main Oct 17, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment