Skip to content

Require agent disclosure when policy is disclose - #71

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
zaguzovmaksim0-hue:fix/disclose-required-agent
Sep 11, 2026
Merged

ralyodio merged 1 commit into
profullstack:masterfrom
zaguzovmaksim0-hue:fix/disclose-required-agent

Conversation

@zaguzovmaksim0-hue

Copy link
Copy Markdown
Contributor

What changed

  • require a non-empty agent disclosure whenever agentPolicy is disclose
  • add a database-free regression test covering omitted disclosure and a valid supervised disclosure

Why

/api/v1/jobs/:slug/apply-schema publishes disclosure.required: true for disclose jobs, but the validator only rejected agent === null when the caller had supplied an agent key. Omitting the key entirely therefore bypassed the published contract.

Before the fix:

validateApplication(schema, { name: 'Ada' }, 'disclose')
=> ok: true, agent: null

After the fix, the same input returns the existing agent validation problem.

Tests

  • node --test test/applications.test.ts — pass
  • pnpm test — pass on Android/Termux; database-dependent API suite skips when local Postgres is unavailable, as designed

Closes #70

@ralyodio
ralyodio merged commit db6de1a into profullstack:master Sep 11, 2026
4 checks passed
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.

Disclose policy accepts applications with omitted agent field

2 participants