@carecard/validate 3.28.0 → 3.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -200,41 +200,42 @@ and remaining risk.
200
200
 
201
201
  ## Remote Git Operations Guardrail
202
202
 
203
- Do not run remote Git or GitHub operations unless the current user request explicitly asks for them. This includes `git fetch`, `git pull`, `git push`, `git push --delete`, remote branch cleanup, GitHub API calls, and any `gh pr` command that creates, updates, readies, merges, closes, or cleans up a pull request. Do not infer permission from branch names, validation needs, prior workflow habits, or convenience; ask first when remote state would help but was not requested.
203
+ Fetches needed to establish a fresh `origin/main` at task start and before a
204
+ source-branch push are authorized without a separate approval question. Commits,
205
+ pushes, PR mutations, and branch cleanup require an authorized task; a request
206
+ for local work alone does not authorize publication. An authorized squash merge
207
+ into `main` includes the merged-source cleanup, local `main` update, and
208
+ `development` synchronization below unless the user explicitly says otherwise.
209
+ Never delete local or remote `main`, or force-push to remote `main`, including
210
+ with `--force-with-lease`.
204
211
 
205
212
  ## Agent Guidance Git Workflow
206
213
 
207
- When this skill or any repository-owned `.agents` guidance changes, use the
208
- repository's agents-only Git workflow:
209
-
210
- 1. Work from the affected repository root and confirm only intended `.agents`
211
- files changed.
212
- 2. Use `development` as the base branch when `origin/development` exists;
213
- otherwise use the repository's default base branch, usually `main`.
214
- 3. Create or update `feature/codex` from the updated remote base branch and
215
- commit all the changed `.agents` guidance files there.
216
- 4. Push `feature/codex`, create or reuse a pull request into the base branch,
217
- and mark the pull request ready for review with `gh pr ready <number>`.
218
- 5. Squash-merge with administrator privileges and delete the remote branch:
219
-
220
- ```sh
221
- gh pr merge <number> --squash --admin --delete-branch
222
- ```
223
-
224
- 6. After merge, update the local base branch and remove the local feature
225
- branch:
226
-
227
- ```sh
228
- git fetch origin <base> --prune
229
- git switch <base>
230
- git pull --ff-only origin <base>
231
- git branch -d feature/codex
232
- git ls-remote --heads origin feature/codex
233
- ```
234
-
235
- Do not commit or push `.agents` guidance changes directly from `development`
236
- or `main`. Do not stage unrelated files, generated output, dependency folders,
237
- build artifacts, logs, or `.DS_Store`.
214
+ Work from the owning repository root and stage only intended guidance changes.
215
+ Use freshly fetched `origin/main` as the default base. Start `<agent-name>/<task-name>`
216
+ from it, or rebase existing work when it does not already contain the latest
217
+ `origin/main`. An explicit user instruction to use the current or another
218
+ working branch overrides the default `<agent-name>/<task-name>` selection.
219
+
220
+ Fetch again before every source-branch push and rebase only when the branch
221
+ does not already contain the latest `origin/main`. Required fetches need no
222
+ separate approval; commits, pushes, PR mutations, and cleanup require an
223
+ authorized task. A local guidance edit does not authorize publishing it.
224
+
225
+ For an authorized merge, create or reuse the PR into `main`, run applicable
226
+ validation, and squash-merge; administrator privileges may be used without
227
+ GitHub reviews. Verify the merge and delete its source branch remotely and
228
+ locally after checking for newer unmerged work. Then fast-forward local `main`
229
+ and replace local and remote branches named exactly `development` with the
230
+ latest remote `main` commit, using an explicit observed-commit
231
+ `--force-with-lease` remotely. Create a missing development counterpart when
232
+ either existed; leave repositories with neither unchanged. If development was
233
+ the merged source, recreate it from the new main. Verify commit parity and
234
+ cleanup; preserve dirty worktrees and report conflicts or rejected leases.
235
+
236
+ Never delete local or remote `main` or force-push to remote `main`, including
237
+ with `--force-with-lease`. Guard exact destination refs before deleting or
238
+ forcing any branch. Do not amend commits or stage unrelated files.
238
239
 
239
240
  ## Fail-Closed Test Lifecycle Audit
240
241
 
package/.codex/AGENTS.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Codex Instructions For pkg-validate
2
2
 
3
+ ## Mandatory startup for every agent
4
+
5
+ Every agent, including Codex, Claude, other assistants, and delegated agents,
6
+ must read and follow [carecard-must-do](../.agents/skills/carecard-must-do/SKILL.md)
7
+ before beginning or resuming any task. This includes planning, questions,
8
+ read-only investigation, coding, review, documentation, and validation.
9
+
10
+ Then load the [repository engineering standards](../.agents/skills/pkg-validate-coding-standards-and-best-practices/SKILL.md)
11
+ and the specialist skills relevant to the task.
12
+ An agent without automatic skill discovery must open the skill explicitly;
13
+ the requirement applies regardless of the agent platform.
14
+
3
15
  ## Non-negotiable Codex banked-reset requirement
4
16
 
5
17
  - Never use or consume a banked Codex rate-limit reset automatically.
@@ -133,10 +145,10 @@ The `pkg-*` directories are reusable CareCard packages. Shared API response, err
133
145
  - Use coverage reports only as diagnostics for potentially untested observable behavior. Percentages for lines, branches, functions, and statements are not functional evidence and must not determine test assertions. Never add implementation-detail tests to preserve a metric or lower thresholds to hide a failing check; report any conflict with the behavior-only policy.
134
146
  - Keep tests readable and domain-specific. Prefer explicit helper names over generic test utilities that hide important behavior.
135
147
  - Use existing test frameworks and layouts:
136
- - JavaScript `api-*`: usually Mocha, Supertest, `test/index.test.js`, and Docker-backed Postgres scripts.
137
- - TypeScript `api-*`: usually Jest and `tests/index.test.ts`.
138
- - `pkg-*`: Mocha plus TypeScript type tests where present.
139
- - `app-dashboard`: Vitest, React Testing Library, mock API tests, and Selenium for end-to-end flows.
148
+ - JavaScript `api-*`: usually Mocha, Supertest, `test/index.test.js`, and Docker-backed Postgres scripts.
149
+ - TypeScript `api-*`: usually Jest and `tests/index.test.ts`.
150
+ - `pkg-*`: Mocha plus TypeScript type tests where present.
151
+ - `app-dashboard`: Vitest, React Testing Library, mock API tests, and Selenium for end-to-end flows.
140
152
  - For database tests, use existing seed, migration, rollback, and cleanup patterns. Keep tests isolated and make cleanup reliable even after failures.
141
153
  - Add tests for API success responses, validation errors, auth/authz errors, JWT errors, not-found/conflict cases, and unexpected error handling when those paths change.
142
154
  - For frontend changes, test rendered UI, public HTTP or network outcomes, navigation, accessibility, and user-visible flows at the narrowest practical level first. Use focused non-test dependency checks for validation, transform, query, mutation, hook, and module organization.
package/AGENTS.md CHANGED
@@ -1,4 +1,16 @@
1
- # Codex Instructions
1
+ # Agent Instructions
2
+
3
+ ## Mandatory startup for every agent
4
+
5
+ Every agent, including Codex, Claude, other assistants, and delegated agents,
6
+ must read and follow [carecard-must-do](.agents/skills/carecard-must-do/SKILL.md)
7
+ before beginning or resuming any task. This includes planning, questions,
8
+ read-only investigation, coding, review, documentation, and validation.
9
+
10
+ Then load the [repository engineering standards](.agents/skills/pkg-validate-coding-standards-and-best-practices/SKILL.md)
11
+ and the specialist skills relevant to the task.
12
+ An agent without automatic skill discovery must open the skill explicitly;
13
+ the requirement applies regardless of the agent platform.
2
14
 
3
15
  ## Non-negotiable Codex banked-reset requirement
4
16
 
package/CLAUDE.md ADDED
@@ -0,0 +1,43 @@
1
+ # Repository Agent Instructions
2
+
3
+ ## Mandatory startup for every agent
4
+
5
+ Every agent, including Codex, Claude, other assistants, and delegated agents,
6
+ must read and follow [carecard-must-do](.agents/skills/carecard-must-do/SKILL.md)
7
+ before beginning or resuming any task. This includes planning, questions,
8
+ read-only investigation, coding, review, documentation, and validation.
9
+
10
+ Then load the [repository engineering standards](.agents/skills/pkg-validate-coding-standards-and-best-practices/SKILL.md)
11
+ and the specialist skills relevant to the task.
12
+ An agent without automatic skill discovery must open the skill explicitly;
13
+ the requirement applies regardless of the agent platform.
14
+
15
+ Also read [AGENTS.md](AGENTS.md) for the full repository instructions.
16
+
17
+ ## Existing repository isolation contract
18
+
19
+ Non-negotiable repository isolation rule: Every repository must run its Husky
20
+ hooks and tests using only files, code, fixtures, dependencies, and services
21
+ contained within that repository. Tests and Husky scripts must not import,
22
+ require, read, execute, or otherwise depend on sibling repositories or paths
23
+ outside the repository root. app-e2e-tests is the only exception because
24
+ cross-repository end-to-end testing is its explicit responsibility.
25
+
26
+ Also apply [$carecard-workspace-standards](.agents/skills/carecard-workspace-standards/SKILL.md)
27
+ for the mandatory TDD and code organization rules.
28
+
29
+ ## Existing test-preservation policy
30
+
31
+ The TDD and validation requirements are non-negotiable and cannot be
32
+ overridden. The separate pre-existing-test protection still requires the
33
+ user's fresh, explicit permission for each exact proposed test modification.
34
+
35
+ A pre-existing test—defined as any test present before work on the current task
36
+ begins—must not be deleted, disabled, skipped, weakened, excluded from execution,
37
+ or otherwise removed. A pre-existing test must not be modified without the
38
+ user's explicit approval for the exact proposed change. If changing a
39
+ pre-existing test is believed necessary, stop before making the change and
40
+ request approval. The request must identify every affected test, describe the
41
+ precise proposed modification, provide detailed technical justification, and
42
+ explain all known or reasonably foreseeable regression risks. Until approval is
43
+ granted, leave every pre-existing test unchanged.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carecard/validate",
3
- "version": "3.28.0",
3
+ "version": "3.29.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/CareCard-ca/pkg-validate.git"
@@ -47,7 +47,7 @@
47
47
  "typescript": "6.0.3"
48
48
  },
49
49
  "dependencies": {
50
- "@carecard/common-util": "3.28.0"
50
+ "@carecard/common-util": "3.29.0"
51
51
  },
52
52
  "nyc": {
53
53
  "all": true,
@@ -67,6 +67,6 @@
67
67
  "glob": "13.0.6",
68
68
  "minimatch": "10.2.6",
69
69
  "serialize-javascript": "7.0.5",
70
- "js-yaml": "4.3.1"
70
+ "js-yaml": "4.3.2"
71
71
  }
72
72
  }