Skip to content

Commit 8677800

Browse files
MalcolmnixonMalcolm NixonCopilotDeveloper Agent
authored
Introduce IFileContainer for enhanced zip content assertions (#54)
* Add IFileContainer abstraction for zip content assertions Introduce IFileContainer (with DirectoryFileContainer and ZipFileContainer implementations) so that the full suite of content assertions (text, xml, yaml, json, html, pdf, and nested zip) can be applied to entries inside a zip archive, recursively. Key changes: - New IContext interface and ScopedContext wrapper for breadcrumb error messages - New IFileContainer interface with Glob(), Size(), Open(), and DisplayName - DirectoryFileContainer wraps a real filesystem directory - ZipFileContainer wraps a ZipArchive (from path or stream, enabling zip-in-zip) - All 7 content asserters updated to Run(IContext, IFileContainer, string entryPath) - FileAssertFile.Run() unified to take IFileContainer (DirectoryInfoWrapper retired) - FileAssertTest constructs DirectoryFileContainer for top-level filesystem runs - FileAssertZipAssert rewritten: entries now use FileAssertFileData (full parity), opens ZipFileContainer per entry, scopes context with breadcrumb prefix - FileAssertZipEntryData deleted; FileAssertZipData.Entries reuses FileAssertFileData - 291 tests across net8/net9/net10 (19 new zip content tests, 2 new modeling tests, 12 new container unit tests, 2 new scoped context tests, 5 new integration tests) - Full companion artifact sweep: requirements, design, verification docs, review sets, README, and user guide all updated Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix formal review findings from IFileContainer feature branch * Add OTS design docs to YamlDotNet, PdfPig, HtmlAgilityPack, FileSystemGlobbing review sets Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix second round of formal review findings * Fix third round of formal review findings - Add malformed-HTML lenient-parse test for HtmlAgilityPack OTS - Add HTML and PDF zip-entry assertion tests - Add multi-page PDF boundary test and PdfMetadataRule negative tests - Add YamlAssert.Create() validation (empty queries, no-op, contradictory min/max) - Split compound FileAssertFile Count/Size requirements into atomic requirements - Fix compound OTS parent requirements (ReviewMark, VersionMark, PdfPig) - Restructure OTS design docs to Purpose/Features Used/Integration Pattern (ReviewMark, VersionMark, xUnit) - Fix OTS-ReviewMark design: document URL-based evidence source and network dependency - Add Features Used and Integration Pattern to OTS-VersionMark design - Fix xUnit 'or equivalent' ambiguity and PrivateAssets claim - Fix AllRequirements traceability: FileTypeParsing, FileTypeParseError, QueryAssertions, JUnit - Add system-level design and verification for --depth flag - Complete HtmlAssert design doc tables - Add JUnit configuration verification scenario - Fix DirectoryFileContainer temp path description - Fix introduction.md References section to use verbal references Tests: 326/326 passing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add 'enation' to cspell word list Used in multi-page PDF boundary tests to verify the page separator prevents cross-page token merging (concat + enation). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Remove flawed LockedFile test and FileTypeReadError requirement File locking via FileShare.None is not reliably enforced on Linux. The IO error path is already covered by per-asserter IOError tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix duplicated breadcrumb in ZipAssert error messages ZipFileContainer.GetDisplayPath already builds the full breadcrumb path (e.g. 'outer.zip > entry.txt'). The additional context.WithPrefix call in FileAssertZipAssert.Run duplicated it, producing messages like 'outer.zip > File ''outer.zip > entry.txt'' ...'. Remove WithPrefix from ZipAssert.Run and rely solely on GetDisplayPath. Also tighten the breadcrumb test to assert the zip name appears exactly once in the error message, so this cannot regress silently. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix PR review findings: silent-pass, backslash patterns, misc - Remove entries: alias (never shipped, no backward compat needed) - Validate zip: block requires at least one files: entry; null/empty now throws InvalidOperationException instead of silently passing - Normalize backslash separators in glob patterns before matching so sub\*.txt works against forward-slash normalized entry paths - Add tests: NullFiles/EmptyFiles throw, BackslashPattern matches, invalid YAML throws, selftest scenario name corrected Tests: 329/329 passing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix MultiRuntime reqstream filter prefix (net8.0 not dotnet8.x) The build job produces TRX files named 'macos-latest_net8.0_*.trx'. ReqStream derives the source filter from the TRX filename, so the correct prefix is 'net8.0@', not 'dotnet8.x@'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Malcolm Nixon <Malcolm.Nixon@hiarc.inc> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Developer Agent <agent@dema.local>
1 parent 08dc5c7 commit 8677800

166 files changed

Lines changed: 7825 additions & 2051 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cspell.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ words:
2626
- deserialize
2727
- deserializes
2828
- dogfooding
29+
- enation
2930
- fileassert
3031
- fontconfig
3132
- initialise

.github/agents/developer.agent.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Perform software development tasks by determining and applying appropriate stand
1919
If one exists, fetch it as the starting point; adjust placeholder names and heading
2020
depth to match the target path before writing the file
2121
- For each modified file, identify which companion artifacts need updating
22-
(requirements, design docs, tests, review-sets)
22+
(requirements, design docs, verification docs, tests, review-sets, README.md, user guides)
2323
- Include companion artifact updates in the work plan
2424
4. **Execute work** following standards requirements and quality checks
2525
5. **Formatting**: Run `pwsh ./fix.ps1` to silently apply all
@@ -35,8 +35,7 @@ Perform software development tasks by determining and applying appropriate stand
3535
# Developer Agent Report
3636

3737
**Result**: (SUCCEEDED|FAILED)
38-
39-
## Work Summary
38+
**Report**: `.agent-logs/developer-{subject}-{unique-id}.md`
4039

4140
- **Files Modified**: {List of files created/modified/deleted}
4241
- **Languages Detected**: {Languages identified}

.github/agents/formal-review.agent.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ standards from the selection matrix in AGENTS.md.
4444
# Formal Review Report
4545

4646
**Result**: (SUCCEEDED|FAILED)
47+
**Report**: `.agent-logs/formal-review-{subject}-{unique-id}.md`
4748

4849
## Review Summary
4950

.github/agents/implementation.agent.md

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,18 @@ The state-transitions include retrying a limited number of times:
2828

2929
## PLANNING State (start)
3030

31-
Call the **explore** agent as a sub-agent (built-in agent type) with:
31+
Call the **planning** agent as a sub-agent (custom agent from `.github/agents/`) with:
3232

3333
- **context**: the user's request + any previous quality findings + retry context
34-
- **goal**: produce a verified implementation plan through these steps:
35-
36-
1. Investigate the codebase and develop a concrete implementation plan that
37-
addresses the request
38-
2. **Identify companion artifact deliverables**: for every code change in the
39-
plan, list the requirements files, design documents, and review-set entries
40-
that must be created or updated - traceability must flow requirements →
41-
design → code, so these are mandatory deliverables, not optional extras
42-
3. Review the plan for assumptions, weaknesses, and gaps - identify up to 5
43-
key assumptions and rate each as:
44-
- **VERIFIED**: confirmed by codebase evidence
45-
- **LIKELY**: consistent with codebase patterns but not directly confirmed
46-
- **UNVERIFIED**: not confirmed by any evidence
47-
4. For any assumption rated UNVERIFIED or LIKELY, attempt to resolve it
48-
through additional investigation and revise the plan to address identified
49-
weaknesses - repeat the critique-and-strengthen cycle up to 2 additional
50-
times if unresolved issues remain, but stop as soon as the plan is stable
51-
5. List up to 5 risks to the implementation
52-
6. Assess feasibility: can this be implemented in a single development pass?
53-
7. State a **recommendation**: GO or INCOMPLETE - GO if the plan is sound, or
54-
INCOMPLETE if critical unknowns remain that only the user can resolve
55-
56-
Once the explore sub-agent finishes:
57-
58-
- IF recommendation is INCOMPLETE: Transition to REPORT with Result: INCOMPLETE,
34+
- **goal**: produce a verified implementation plan, or a targeted plan to address
35+
the identified quality issues if this is a retry
36+
37+
Once the planning sub-agent finishes:
38+
39+
- IF Result is FAILED: Transition to REPORT with Result: FAILED
40+
- IF Result is INCOMPLETE: Transition to REPORT with Result: INCOMPLETE,
5941
listing the unknowns and what CAN be implemented once they are resolved
60-
- OTHERWISE (GO): Transition to DEVELOPMENT
42+
- OTHERWISE (SUCCEEDED): Transition to DEVELOPMENT
6143

6244
## DEVELOPMENT State
6345

@@ -76,7 +58,8 @@ Once the developer sub-agent finishes:
7658

7759
Call the **quality** agent as a sub-agent (custom agent from `.github/agents/`) with:
7860

79-
- **context**: the user's request + development summary + files changed + previous issues (if any)
61+
- **context**: the user's request + development summary + files changed + planning companion artifact table +
62+
previous issues (if any)
8063
- **goal**: check the quality of the work performed for any issues
8164

8265
Once the quality sub-agent finishes:
@@ -92,6 +75,9 @@ Once the quality sub-agent finishes:
9275
this agent may report INCOMPLETE when the request cannot be implemented without
9376
information only the user can provide.
9477

78+
For full planning details (assumptions, risks, feasibility), read the planning
79+
report file referenced in the planning agent's response.
80+
9581
Generate the completion report using the template below, then save it to
9682
`.agent-logs/{agent-name}-{subject}-{unique-id}.md` per the AGENTS.md reporting
9783
requirements, and return the summary to the caller.
@@ -102,19 +88,20 @@ requirements, and return the summary to the caller.
10288
# Implementation Orchestration Report
10389

10490
**Result**: (SUCCEEDED|FAILED|INCOMPLETE)
105-
**Final State**: (PLANNING|DEVELOPMENT|QUALITY|REPORT)
91+
**Report**: `.agent-logs/implementation-{subject}-{unique-id}.md`
92+
**Last Active State**: (PLANNING|DEVELOPMENT|QUALITY)
10693
**Retry Count**: <Number of quality retry cycles>
10794

10895
## State Machine Execution
10996

110-
- **Planning Results**: {Implementation plan, assumption ratings, risks, and recommendation}
97+
- **Planning Results**: {Planning report path; plan summary and SUCCEEDED/INCOMPLETE/FAILED result}
11198
- **Development Results**: {Summary of developer agent results}
11299
- **Quality Results**: {Summary of quality agent results}
113100
- **State Transitions**: {Log of state changes and decisions}
114101

115102
## Sub-Agent Coordination
116103

117-
- **Explore Agent (Planning)**: {Plan, assumption verdicts, top risks, GO/INCOMPLETE recommendation}
104+
- **Planning Agent**: {Report file path, SUCCEEDED/INCOMPLETE/FAILED result, plan summary}
118105
- **Developer Agent**: {Development status and files modified}
119106
- **Quality Agent**: {Validation results and compliance status}
120107

@@ -123,4 +110,9 @@ requirements, and return the summary to the caller.
123110
- **Implementation Success**: {Overall completion status}
124111
- **Quality Compliance**: {Final quality validation status}
125112
- **Issues Resolved**: {Problems encountered and resolution attempts}
113+
114+
## Unknowns (only when Result is INCOMPLETE)
115+
116+
- **Unresolved Questions**: {List each question the user must answer}
117+
- **What Can Proceed**: {Work that can be done without the missing information}
126118
```

.github/agents/lint-fix.agent.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ submission, not during normal development.
6868
# Lint Fix Report
6969

7070
**Result**: (SUCCEEDED|FAILED)
71-
72-
## Summary
71+
**Report**: `.agent-logs/lint-fix-{subject}-{unique-id}.md`
7372

7473
- **Iterations**: {Number of fix-loop iterations performed}
7574
- **Files Modified**: {List of all files changed}

.github/agents/planning.agent.md

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
name: planning
3+
description: Planning agent that investigates the codebase, develops a verified implementation plan, and identifies all companion artifact deliverables.
4+
user-invocable: true
5+
---
6+
7+
# Planning Agent
8+
9+
Investigate the codebase and produce a verified implementation plan with all
10+
companion artifact deliverables.
11+
12+
## Step 1 — Load Standards
13+
14+
Read the relevant standards from `.github/standards/` using the selection matrix
15+
in `AGENTS.md` based on the artifact types in scope for the request (requirements,
16+
design, verification, documentation, code).
17+
18+
## Step 2 — Investigate and Plan
19+
20+
Read `docs/design/introduction.md` first (if present), then investigate the
21+
codebase to develop a concrete implementation plan:
22+
23+
- Identify all files to create, modify, or delete
24+
- Describe the change required for each file
25+
26+
## Step 3 — Identify Companion Artifact Deliverables
27+
28+
For each planned change, assess the mandatory companion artifacts below (create/update/N/A
29+
with justification):
30+
31+
- **Requirements** — functional changes require a requirement entry
32+
- **Design Documentation** — new or changed components require design docs
33+
- **Verification Documentation** — new or changed components require verification docs
34+
- **Tests** — functional changes require test coverage
35+
- **Review Sets** — changes to the software item hierarchy (units or subsystems
36+
added, removed, or reorganized) require review-set updates
37+
- **README.md** — user-facing changes require README updates
38+
- **User Guide** — user-facing features require user guide updates
39+
40+
## Step 4 — Critique and Strengthen
41+
42+
Identify up to 5 key assumptions and rate each:
43+
44+
- **VERIFIED**: confirmed by codebase evidence
45+
- **LIKELY**: consistent with codebase patterns but not directly confirmed
46+
- **UNVERIFIED**: not confirmed by any evidence
47+
48+
For UNVERIFIED or LIKELY assumptions, investigate further and revise the plan.
49+
Repeat up to 2 more times, stopping when the plan is stable.
50+
51+
## Step 5 — Risk Assessment
52+
53+
List up to 5 risks with a brief mitigation for each.
54+
55+
## Step 6 — Feasibility Assessment
56+
57+
State whether this can be implemented in a single development pass and any
58+
preconditions that affect feasibility.
59+
60+
## Step 7 — Recommendation
61+
62+
- **SUCCEEDED** — the plan is sound and the developer agent can proceed
63+
- **INCOMPLETE** — critical unknowns remain that only the user can resolve;
64+
list each unknown explicitly
65+
- **FAILED** — investigation could not produce a viable plan
66+
67+
# REPORT Phase
68+
69+
Save the full analysis to `.agent-logs/planning-{subject}-{unique-id}.md` per
70+
the AGENTS.md reporting requirements.
71+
72+
Then respond to the caller with ONLY the lean structured summary below.
73+
74+
# Report Template
75+
76+
```markdown
77+
# Planning Report
78+
79+
**Result**: (SUCCEEDED|INCOMPLETE|FAILED)
80+
**Request Summary**: {Brief restatement of the task as understood}
81+
**Report**: `.agent-logs/planning-{subject}-{unique-id}.md`
82+
83+
## Implementation Plan
84+
85+
| File | Action | Description |
86+
|------|--------|-------------|
87+
| {path} | create/modify/delete | {what changes and why} |
88+
89+
## Companion Artifact Deliverables
90+
91+
| Category | File | Action |
92+
|----------|------|--------|
93+
| Requirements | {path} | create/update/N/A — {justification} |
94+
| Design Documentation | {path} | create/update/N/A — {justification} |
95+
| Verification Documentation | {path} | create/update/N/A — {justification} |
96+
| Tests | {path} | create/update/N/A — {justification} |
97+
| Review Sets | {path} | create/update/N/A — {justification} |
98+
| README.md | {path} | create/update/N/A — {justification} |
99+
| User Guide | {path} | create/update/N/A — {justification} |
100+
101+
## Assumption Analysis
102+
103+
| # | Assumption | Rating | Resolution |
104+
|---|-----------|--------|------------|
105+
| 1 | {assumption} | VERIFIED/LIKELY/UNVERIFIED | {resolution or N/A} |
106+
107+
## Risk Assessment
108+
109+
1. **[severity]** {risk} — {mitigation}
110+
111+
## Feasibility Assessment
112+
113+
{Single-pass or not, and why. Any preconditions.}
114+
115+
## Unknowns
116+
117+
{Only present when Result is INCOMPLETE. List each question the user must
118+
resolve before implementation can proceed.}
119+
```
120+
121+
# Lean Structured Response (returned to caller)
122+
123+
```markdown
124+
**Result**: (SUCCEEDED|INCOMPLETE|FAILED)
125+
**Report**: `.agent-logs/planning-{subject}-{unique-id}.md`
126+
127+
**Plan**:
128+
{Repeat the Implementation Plan table}
129+
130+
**Companion Artifacts**:
131+
{Repeat the Companion Artifact Deliverables table}
132+
133+
**Unknowns**: {Only if INCOMPLETE — list questions for the user}
134+
```

.github/agents/quality.agent.md

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,23 @@ Grade and validate software development work by ensuring compliance with project
1313
1. **Analyze the task request AND completed work** to determine scope: identify
1414
which artifact categories were changed, and which *should have been changed*
1515
given the task - new user-visible features always require requirements,
16-
design, and review-set coverage regardless of whether those files were touched;
17-
test-only additions (corner-case tests, defensive boundary tests, regression
18-
tests) do not require a corresponding requirement
16+
design, verification docs, and README/user guide updates regardless of
17+
whether those files were touched; Review Sets are always in scope when
18+
the software item hierarchy changes (units or subsystems added, removed, or
19+
reorganized); test-only additions (corner-case tests, defensive boundary
20+
tests, regression tests) do not require a corresponding requirement; if a
21+
planning companion artifact table is provided in context, cross-reference it
22+
— any artifact listed as create/update must be covered in the evaluation and
23+
FAIL if the artifact was not produced
1924
2. **Read relevant standards** using the selection matrix in AGENTS.md
2025
3. **Evaluate all in-scope categories** - N/A only when the task genuinely
2126
cannot affect a category; if the task introduces new user-visible features or
22-
structural changes then Requirements, Design Documentation, and Review
23-
Management are always in scope and FAIL if the artifacts were not updated
27+
structural changes then Requirements, Design Documentation, and Verification
28+
Documentation are always in scope and FAIL if the artifacts were not updated;
29+
Documentation (README/user guide) is always in scope for user-facing changes
30+
and FAIL if not updated; Review Sets are always in scope when the
31+
software item hierarchy changes (units or subsystems added, removed, or
32+
reorganized) and FAIL if review-sets were not updated
2433
4. **Validate tool compliance** using ReqStream, ReviewMark, and build tools
2534
5. **Generate focused quality report** per the AGENTS.md reporting requirements - save to
2635
`.agent-logs/{agent-name}-{subject}-{unique-id}.md` and return the summary to the caller
@@ -36,6 +45,7 @@ For each checklist item in the template below, record as `(PASS|FAIL|N/A) - {one
3645
# Quality Assessment Report
3746

3847
**Result**: (SUCCEEDED|FAILED)
48+
**Report**: `.agent-logs/quality-{subject}-{unique-id}.md`
3949
**Overall Grade**: (PASS|FAIL)
4050

4151
## Required Fixes (only when Result is FAILED)
@@ -50,13 +60,13 @@ Priority-ordered list of issues that MUST be resolved for the next retry:
5060

5161
- **Evaluated**: {List sections assessed and why}
5262
- **Skipped**: {One-line per skipped section with reason, e.g., "Design
53-
Documentation: N/A - no design files modified"}
63+
Documentation: N/A - no component behavior, structure, or interface changed"}
5464

5565
## Requirements Compliance: (PASS|FAIL|N/A)
5666

5767
- Were requirements created/updated for all functional changes?
5868
- Were source filters applied for platform-specific requirements?
59-
- Is requirements traceability maintained to tests?
69+
- Is forward traceability from requirements to verification artifacts preserved?
6070

6171
## Design Documentation Compliance: (PASS|FAIL|N/A)
6272

@@ -80,7 +90,14 @@ Priority-ordered list of issues that MUST be resolved for the next retry:
8090
- Are cross-hierarchy test dependencies documented in design docs?
8191
- Do all tests pass?
8292

83-
## Review Management Compliance: (PASS|FAIL|N/A)
93+
## Verification Documentation Compliance: (PASS|FAIL|N/A)
94+
95+
- Were verification documents created/updated for all new or changed components?
96+
- Do verification documents include all mandatory sections (Verification Approach, Test Environment,
97+
Acceptance Criteria, Test Scenarios)?
98+
- Is requirements-to-test coverage tracked via the ReqStream trace matrix (not embedded in verification docs)?
99+
100+
## Review Sets Compliance: (PASS|FAIL|N/A)
84101

85102
- Were review-sets updated for structural changes?
86103
- Is review scope appropriate for change magnitude?

0 commit comments

Comments
 (0)