feat: modified agent behavior for a more test centric workflow
This commit is contained in:
@@ -74,14 +74,17 @@
|
||||
---
|
||||
|
||||
## 6. Test-Driven Development (TDD) & Adversarial Verification
|
||||
1. **Red-Green-Refactor Lifecycle:**
|
||||
- Write tests in `test/*.test.js` using Node's native test runner (`node:test`, `node:assert/strict`).
|
||||
- Test inputs before implementing filters, data loaders, or template macros.
|
||||
2. **Adversarial Test Coverage Required:**
|
||||
- **Data & Configuration:** Test that missing required environment variables (e.g. `SITE_DOMAIN`) throw fatal errors.
|
||||
- **Filters:** Test edge cases: empty strings, undefined values, single-word inputs, massive word counts, non-date objects.
|
||||
- **Content Schemas:** Validate all Markdown files in `src/posts/` against frontmatter schemas.
|
||||
- **Design Spec Compliance:** Automate regex/AST assertions on `src/assets/css/` ensuring zero violations of the "Do Not Use" list (`backdrop-filter`, `box-shadow`, `text-shadow`, gradients, floaty transitions).
|
||||
- **Link & Anchor Integrity:** Verify that every compiled page has zero broken internal links and that all Table of Contents anchor links resolve to valid heading IDs.
|
||||
3. **Execution Invariant:**
|
||||
- Always run `npm test` before committing. All tests must pass cleanly with 0 failures.
|
||||
1. **Strict Pre-Implementation Testing (Tests Before Functional Code):**
|
||||
- Test cases MUST ALWAYS be written in `test/*.test.js` before writing or modifying any functional code (filters, templates, server routes, ingestion pipeline, data loaders, scripts).
|
||||
- Never implement or modify functional or production code prior to writing and establishing corresponding automated tests.
|
||||
2. **Mandatory Adversarial Test Coverage:**
|
||||
- Standard behavior for any functional change MUST ALWAYS include adversarial testing specifically designed to stress assumptions and break the system:
|
||||
- **Data & Configuration:** Test that missing required environment variables (e.g. `SITE_DOMAIN`) throw fatal errors.
|
||||
- **Filters & Logic:** Test edge cases: empty strings, undefined/null values, unexpected types, single-word inputs, massive word counts, non-date objects.
|
||||
- **Security & Integrity:** Test path traversals, malformed JSON, unauthorized tokens, malicious payloads.
|
||||
- **Content Schemas:** Validate all Markdown files in `src/posts/` against frontmatter schemas.
|
||||
- **Design Spec Compliance:** Automate regex/AST assertions on `src/assets/css/` ensuring zero violations of the "Do Not Use" list (`backdrop-filter`, `box-shadow`, `text-shadow`, gradients, floaty transitions).
|
||||
- **Link & Anchor Integrity:** Verify that every compiled page has zero broken internal links and that all Table of Contents anchor links resolve to valid heading IDs.
|
||||
3. **Pre-Presentation Verification Gate:**
|
||||
- Before presenting the final output to the user, run `npm test`.
|
||||
- All test cases must pass before presenting the final output. Presenting unverified output or code with failing tests is strictly prohibited.
|
||||
|
||||
Reference in New Issue
Block a user