ai-engineering-loop 1.0.13 → 1.0.15

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.
Files changed (47) hide show
  1. package/.agents/devil-advocate.md +1 -1
  2. package/.agents/judge.md +1 -1
  3. package/.agents/workflows/ai-engineering-loop.md +1 -1
  4. package/.claude/agents/devil-advocate.md +1 -1
  5. package/.claude/agents/judge.md +1 -1
  6. package/.claude/skills/ai-engineering-loop/SKILL.md +2 -2
  7. package/.gemini/skills/ai-engineering-loop/SKILL.md +2 -2
  8. package/.grok/agents/devil-advocate.md +1 -1
  9. package/.grok/agents/judge.md +1 -1
  10. package/.grok/skills/ai-engineering-loop/SKILL.md +2 -2
  11. package/README.md +4 -4
  12. package/adapters/dot/README.md +8 -8
  13. package/adapters/dot/coreview.md +3 -2
  14. package/adapters/dot/gitlab.md +3 -3
  15. package/adapters/dot/mattermost.md +59 -71
  16. package/adapters/dot/multi-branch.md +3 -2
  17. package/adapters/dot/skills/dot-dev-workflow/SKILL.md +2 -2
  18. package/adapters/dot/skills/task-impact-inquiry/SKILL.md +155 -0
  19. package/agents/judge.md +2 -1
  20. package/agents/maker.md +1 -1
  21. package/agents/shared/devil-advocate.body.md +1 -1
  22. package/agents/shared/judge.body.md +1 -1
  23. package/bin/ai-engineering-loop.js +2 -2
  24. package/core/goal-contract.md +10 -3
  25. package/core/grill-policy.md +17 -11
  26. package/core/judge-policy.md +1 -0
  27. package/core/verification-loop.md +3 -1
  28. package/examples/backend-api/payment-idempotency/README.md +3 -3
  29. package/examples/dot/status-display/README.md +23 -0
  30. package/examples/dot/status-display/delivery-report.md +41 -0
  31. package/examples/dot/status-display/goal-contract.md +46 -0
  32. package/examples/dot/status-display/judge-verdict.md +44 -0
  33. package/examples/dot/status-display/review-findings.md +63 -0
  34. package/examples/initialization/README.md +2 -2
  35. package/examples/initialization/discovery-trace.md +1 -1
  36. package/examples/mobile-app/offline-sync-queue/README.md +3 -3
  37. package/lib/sync-hosts.js +4 -1
  38. package/package.json +1 -1
  39. package/policies/tdd-policy.md +23 -4
  40. package/tests/no-company-leak.test.js +82 -0
  41. package/tests/skill-host-compat.test.js +54 -7
  42. package/tests/sync-hosts.test.js +19 -1
  43. package/examples/dot/attendance-confirmation/README.md +0 -22
  44. package/examples/dot/attendance-confirmation/delivery-report.md +0 -51
  45. package/examples/dot/attendance-confirmation/goal-contract.md +0 -39
  46. package/examples/dot/attendance-confirmation/judge-verdict.md +0 -43
  47. package/examples/dot/attendance-confirmation/review-findings.md +0 -57
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: task-impact-inquiry
3
+ description: Map business blast radius before code. Use for impact, side effects, sibling data, approval, queues, or when a new developer must learn the current flow. Triggers: cek impactnya, blast radius, analisa pengaruh, brainstorming impact. Not a substitute for ai-engineering-loop.
4
+ ---
5
+
6
+ # Task Impact Inquiry
7
+
8
+ Map the **current business flow** and the **blast radius** of a change before any production edit.
9
+
10
+ This skill fills AI Engineering Loop Stage 1 grill. It is not a parallel engineering OS.
11
+
12
+ If Stage 1 grill already produced this matrix and the user confirmed it, stop. Do not interview again. On commit-bound work, continue in `ai-engineering-loop` (freeze the Goal Contract, then Maker). Do not start `dot-dev-workflow` Phases 1-6.
13
+
14
+ ## Hard gate
15
+
16
+ Do not create a branch or edit production code until:
17
+
18
+ 1. The current lifecycle is drawn from evidence (not guessed).
19
+ 2. The impact matrix is on screen.
20
+ 3. The user has answered the probing questions (or waived them).
21
+
22
+ Green unit tests later are not proof that siblings, approvals, or downstream jobs survived. A 100% passing suite can still reset approved history or fire the wrong downstream job.
23
+
24
+ ## When to use
25
+
26
+ - "cek impactnya", "blast radius", "analisa pengaruh", "brainstorming impact"
27
+ - Bug, edge case, or business-logic change
28
+ - Shared service, status transition, calculation, validation, authorization, schema
29
+ - The user is new to the domain and does not know the flow
30
+
31
+ Impact-only (no implementation): run this skill and stop after the report.
32
+
33
+ Commit-bound work: run this inside AEL Stage 1, then freeze. Do not run it a second time after grill.
34
+
35
+ ## Host notes
36
+
37
+ Claude Code / Kiro: no mermaid, no LaTeX, no extra tool keys. ASCII diagrams only.
38
+
39
+ Grok: do not spawn children for this skill. Stay in the parent.
40
+
41
+ Look up facts (files, enums, jobs). Grill only **decisions**.
42
+
43
+ ## Steps
44
+
45
+ ### 1. Look up (do not ask)
46
+
47
+ Read in this order. Skip a source if it is missing. Do not invent statuses.
48
+
49
+ 1. `.ai-engineering-loop/glossary.md`
50
+ 2. Existing FSD if present (`docs/fsd/`, `specs-book/fsd/`, especially `impact-matrix.md`). Read only. Do not generate an FSD.
51
+ 3. Status enums, services, validators, listeners, BullMQ / cron / queue processors
52
+ 4. Matching FE pages, routes, and permission guards when both FE and BE are in the workspace
53
+
54
+ Cite the path for each claim. If FE or BE is missing, say so.
55
+
56
+ ### 2. New-dev briefing + lifecycle picture
57
+
58
+ Explain the current flow in plain language for someone new to the app: who acts, what status changes, when a period locks.
59
+
60
+ Then draw the lifecycle in ASCII. Do not ask the user what the code already shows.
61
+
62
+ ```text
63
+ Author submit -> DRAFT
64
+ Author send -> NEED_APPROVAL
65
+ Reviewer approve -> APPROVED
66
+ period lock -> CONFIRMED --> billing / aggregate job
67
+ ```
68
+
69
+ If the flow cannot be determined from the repo, say what is missing.
70
+
71
+ ### 3. Four-pillar scan
72
+
73
+ **State and conditions.** Does the rule apply the same in normal vs special cases (rush vs standard, holiday, locked vs open period)? What happens in DRAFT, SUBMITTED, NEED_APPROVAL, APPROVED, REJECTED, CONFIRMED, UNCONFIRMED?
74
+
75
+ **Sibling / historical isolation.** If entity A in parent P changes, do B and C in the same parent, period, or cart change? Can already-approved history reset?
76
+
77
+ **Actor and approval.** Who creates, who may edit, who must re-approve? When is an existing approval void, and when must it be kept?
78
+
79
+ **Downstream.** BullMQ, cron, listeners, billing, dashboard totals.
80
+
81
+ ### 4. Where it hits (hit map + blast picture)
82
+
83
+ List the surfaces a naive edit would touch. Empty rows mean you have not finished looking.
84
+
85
+ ```text
86
+ Surface Path / job Naive risk
87
+ FE page <route or page> <what the user would see>
88
+ BE service <service / status write> <what the row would become>
89
+ Sibling rows <same parent / period / cart> isolate | also-update
90
+ Approval <who, void vs keep> <approval lost or kept>
91
+ Queue / billing <job name> rerun | skip
92
+ ```
93
+
94
+ Then the blast-radius picture (ASCII only):
95
+
96
+ ```text
97
+ edit(A in period P)
98
+ |- sibling B in P : isolate | also-update
99
+ |- approval on A : void | keep
100
+ |- billing / queue : rerun | skip
101
+ ```
102
+
103
+ ### 5. Impact matrix (failure table)
104
+
105
+ | Scenario | Current logic (cite path) | Side effect if we ship naive | Proposed treatment |
106
+ |---|---|---|---|
107
+ | Happy path | | | |
108
+ | Empty / omitted field | | | |
109
+ | Boundary (min/max, locked vs open) | | | |
110
+ | Sibling in the same parent | | | |
111
+ | Error / denied / unauthorized | | | |
112
+
113
+ A matrix with only the sunny path is not done.
114
+
115
+ ### 6. Probing questions
116
+
117
+ Ask 2-3 decisions. Number them. Give a recommended answer. Wait.
118
+
119
+ ```text
120
+ Q1 - <title>: <choices>
121
+ Recommended: <your answer>
122
+ ```
123
+
124
+ Typical decisions: void vs keep approval; isolate vs also-update siblings; rerun vs skip the downstream job.
125
+
126
+ ### 7. Contract rows
127
+
128
+ Each accepted matrix row becomes a numbered AC in the Goal Contract **file** (failure table). Name the seam or artifact.
129
+
130
+ If this session is AEL: freeze after those ACs are in the file. Chat `setuju` is not freeze.
131
+
132
+ If this session is impact-only: print the report and stop. Do not implement.
133
+
134
+ ## Output
135
+
136
+ ```text
137
+ Task impact inquiry
138
+ Briefing: <plain-language current flow>
139
+ Lifecycle: <ASCII>
140
+ Hit map: <surfaces + paths>
141
+ Blast radius: <ASCII>
142
+ Matrix: <table>
143
+ Questions: Q1..Qn with Recommended
144
+ Proposed AC: AC-1..N (happy, empty/omit, boundary, sibling, error)
145
+ Next: freeze Goal Contract | stop (impact-only)
146
+ ```
147
+
148
+ ## Forbidden
149
+
150
+ - Implementing, branching, or "small fix while we discuss"
151
+ - Second interview after AEL grill already captured the matrix
152
+ - Mermaid or LaTeX
153
+ - Claiming isolation because unit tests passed
154
+ - Inventing business rules the repo and the user did not supply
155
+ - Generating an FSD or starting `dot-dev-workflow` as a second loop
package/agents/judge.md CHANGED
@@ -49,7 +49,8 @@ flowchart LR
49
49
 
50
50
  ### Step 2: Goal Contract Compliance Audit
51
51
  - Cross-reference every Acceptance Criterion (AC-1 through AC-N) from the [Goal Contract](file:///Users/egagofur/Development/work/ai-engineering-loop/core/goal-contract.md).
52
- - Verify that automated tests exist that explicitly exercise and prove each criterion.
52
+ - Verify that automated tests exist that explicitly exercise and prove each criterion, including non-happy-path rows in the failure table.
53
+ - A happy-path-only suite while the contract lists empty, boundary, sibling, or error rows is `ITERATE`.
53
54
  - Verify that no out-of-scope files were touched and technical constraints were respected.
54
55
 
55
56
  ### Step 3: Finding Triage & Evidence Verification
package/agents/maker.md CHANGED
@@ -28,7 +28,7 @@ flowchart LR
28
28
  3. **Test-Driven Engineering** ([TDD Policy](file:///Users/egagofur/Development/work/ai-engineering-loop/policies/tdd-policy.md)):
29
29
  - Red before green at the Goal Contract's named seams only.
30
30
  - Tests observe public behavior, use glossary terms, and never assert implementation details.
31
- - Cover the AC slice in play: happy path, negative edge, null/empty, boundary. Vertical slices, not all-tests-then-all-code.
31
+ - Cover the AC slice in play: happy path, empty/omit, boundary, sibling/isolation, error/denied. One red test per AC row. Vertical slices, not all-tests-then-all-code.
32
32
  4. **Addressing Reviewer Findings**:
33
33
  - In subsequent iterations, ingest findings from the [Devil's Advocate](file:///Users/egagofur/Development/work/ai-engineering-loop/agents/devil-advocate.md) and directives from the [Judge](file:///Users/egagofur/Development/work/ai-engineering-loop/agents/judge.md).
34
34
  - Fix validated issues surgically.
@@ -22,7 +22,7 @@ Do not ask for Maker rationale.
22
22
 
23
23
  Report Spec and Standards as separate findings. Do not rerank one axis with the other. A change can pass Spec and fail Standards, or the reverse. Do not spawn children to split axes.
24
24
 
25
- **Spec** (`axis: "spec"`): Goal Contract acceptance criteria, correctness, error handling, security, concurrency, tests that fail to prove an AC. BLOCKER or HIGH only for a real AC breach or runtime defect.
25
+ **Spec** (`axis: "spec"`): Goal Contract acceptance criteria, correctness, error handling, security, concurrency, tests that fail to prove an AC, happy-path-only suite vs written failure table. BLOCKER or HIGH only for a real AC breach or runtime defect.
26
26
 
27
27
  **Standards** (`axis: "standards"`): `.ai-engineering-loop/conventions.md` plus the smell baseline below. Judgement calls: severity MEDIUM or LOW. Set `hardConvention: true` only when conventions.md states a hard rule that this hunk violates. A smell that hides an AC defect is Spec, not Standards.
28
28
 
@@ -10,7 +10,7 @@ Use only paths in the spawn prompt: Goal Contract, verification evidence, Findin
10
10
 
11
11
  AC source is the Goal Contract **file** only. Chat `setuju` and the parent transcript are not AC. Do not PASS because the parent agreed in chat. `CONTEXT_ISOLATION_ONLY` does not relax this.
12
12
 
13
- ITERATE if verification is missing, vague, non-zero, proves a different artifact than the AC names, or is only a source grep.
13
+ ITERATE if verification is missing, vague, non-zero, proves a different artifact than the AC names, is only a source grep, or is happy-path-only while the Goal Contract lists empty, boundary, sibling, or error rows.
14
14
 
15
15
  ## Axes
16
16
 
@@ -21,7 +21,7 @@ const {
21
21
  formatHostSyncReport
22
22
  } = require('../lib/sync-hosts.js');
23
23
 
24
- const VERSION = '1.0.13';
24
+ const VERSION = '1.0.15';
25
25
  const CWD = process.cwd();
26
26
  const CONTEXT_DIR = path.join(CWD, '.ai-engineering-loop');
27
27
 
@@ -275,7 +275,7 @@ function generateContextFiles(rootDir, discovery, trigger = 'init', impact = 'IN
275
275
 
276
276
  // 0. metadata.json (Baseline)
277
277
  const metadataJson = {
278
- contextVersion: '1.0.13',
278
+ contextVersion: '1.0.15',
279
279
  generatedAt: new Date().toISOString(),
280
280
  repositoryRevision: currentRevision,
281
281
  projectProfile: discovery.profile,
@@ -29,9 +29,15 @@ Every Goal Contract MUST adhere to the following schema in Markdown or structure
29
29
  [Explain what changes for the real-world actor (e.g. Employee, Admin, Customer, System). Describe the before/after lifecycle state transition.]
30
30
 
31
31
  ## 3. Acceptance Criteria (AC)
32
- - [ ] AC-1: [Exact, testable statement with expected outcome]
33
- - [ ] AC-2: [Exact, testable statement with expected outcome]
34
- - [ ] AC-3: [Edge case or boundary behavior explicitly specified]
32
+ Each AC is one row that can **fail**. Happy path alone is not a contract (`policies/tdd-policy.md`).
33
+
34
+ | AC | Input / actor | Expected at seam | Must fail if missing |
35
+ |---|---|---|---|
36
+ | AC-1 | Happy path | [observable] | [what would still look green] |
37
+ | AC-2 | Empty / omitted field | [observable] | [what would still look green] |
38
+ | AC-3 | Boundary | [observable] | [what would still look green] |
39
+ | AC-4 | Sibling / isolation (if domain has siblings) | [observable] | [what would still look green] |
40
+ | AC-5 | Error / denied / locked | [observable] | [what would still look green] |
35
41
 
36
42
  ## 4. Technical Constraints
37
43
  - [Architecture]: [Preserve existing patterns, layer boundaries, dependency conventions]
@@ -105,3 +111,4 @@ Every single item listed under `Acceptance Criteria` must map to at least one co
105
111
  - **The Self-Serving Goal**: Modifying acceptance criteria post-hoc when tests fail rather than fixing the underlying implementation.
106
112
  - **The Chat Contract**: Treating "setuju" in the parent transcript as AC. The file is the contract.
107
113
  - **The Wrong Artifact**: Tests pass on a `/tmp` build while the sample the user opens omits the feature.
114
+ - **The Happy-Path Contract**: Only the sunny case is an AC. Coverage % is not a substitute for a failure table.
@@ -45,22 +45,26 @@ Before Maker starts:
45
45
 
46
46
  If a decision was agreed in chat and is missing from the file, the contract is not frozen. Do not start Maker.
47
47
 
48
- ## DOT adapter (`adapter_type: dot`)
48
+ ## Business blast radius
49
49
 
50
- On DOT repositories, grill is **one** session that includes the four-pillar blast radius from Antigravity skill `task-impact-inquiry` (`~/.gemini/config/skills/task-impact-inquiry/SKILL.md`). Do not run that skill as a second interview after grill.
50
+ Green unit tests are not proof that sibling rows, approvals, or downstream jobs survived.
51
51
 
52
- The four pillars must appear in the grill (and then in the Goal Contract) whenever the change can touch:
52
+ When the change can touch state, siblings, actors/approvals, or downstream work, grill **must** include blast radius even if AC look obvious or the user said "just do it". Typo, lint, and version-bump skips still apply.
53
53
 
54
- 1. State and condition permutations (status, overtime vs normal hours, locked vs open periods)
55
- 2. Sibling / historical isolation (other entities in the same parent, period, or cart)
56
- 3. Actor and approval authority (who edits, when an existing approval is void vs kept)
57
- 4. Downstream jobs and queues (BullMQ, cron, payroll/aggregates)
54
+ On `adapter_type: dot`, this is mandatory. On other adapters, skip only when the change cannot touch those four (copy, CSS, comment).
58
55
 
59
- **Do not skip grill** for those four cases, even if AC look obvious or the user said "just do it". Typo, lint, and version-bump skips still apply.
56
+ Canonical skill: `adapters/dot/skills/task-impact-inquiry/SKILL.md`. Host copies via `sync-hosts`: `~/.claude/skills/task-impact-inquiry/`, `~/.grok/skills/task-impact-inquiry/`, `~/.gemini/config/skills/task-impact-inquiry/`. Load that skill if present. If it is missing, still run this section. Do not claim the skill ran.
60
57
 
61
- If the skill file is missing on this host, still ask the four pillars from this section. Do not claim the Gemini skill ran.
58
+ If Stage 1 grill already produced the matrix and the user confirmed it, do not run a second interview.
62
59
 
63
- Present the impact matrix and 2–3 probing questions in the same grill round as other Stage 1 decisions. Recommended answers required. After the frontier is empty, freeze the Goal Contract once.
60
+ In the same grill round:
61
+
62
+ 1. Look up the current flow. Draw an ASCII lifecycle (actor → status → lock). Do not ask look-up facts.
63
+ 2. Scan four pillars: state/conditions; sibling/historical isolation; actor and approval (void vs keep); downstream jobs and queues.
64
+ 3. ASCII blast-radius picture. No mermaid.
65
+ 4. Impact matrix (happy, empty/omit, boundary, sibling, error). Sunny-path-only is not done.
66
+ 5. 2–3 probing questions with recommended answers. Wait.
67
+ 6. Each accepted row becomes a numbered AC in the Goal Contract **file** (failure table).
64
68
 
65
69
  ## Design tree
66
70
 
@@ -80,12 +84,14 @@ The grill is done when the frontier is empty: every branch visited, nothing sile
80
84
  ## What the grill must settle
81
85
 
82
86
  - Objective and business outcome
83
- - Acceptance criteria that can fail a test
87
+ - Acceptance criteria that can fail a test, as a **failure table** (not happy path only)
84
88
  - Out of scope
85
89
  - Test **seams** (public interfaces to observe; prefer existing seams; fewer is better)
86
90
  - Glossary terms to use (read and update `.ai-engineering-loop/glossary.md`)
87
91
  - Hard decisions that belong in an ADR under `.ai-engineering-loop/adrs/`
88
92
 
93
+ A Goal Contract with only the sunny path is not frozen. Include at least: happy path, empty/omitted input, one boundary, one isolation/sibling (when the domain has siblings), one error/denied path. DOT four-pillar rows count toward this table.
94
+
89
95
  ## Invariants
90
96
 
91
97
  - No production code edits during grill.
@@ -64,6 +64,7 @@ The Judge renders decisions based strictly on **Validity + Severity**, then **re
64
64
  2. Active iteration count is below MAX_ITERATIONS (default 3).
65
65
  3. Maker or verification cites chat agreement for behavior that is not an AC in the Goal Contract file.
66
66
  4. Evidence is for the wrong artifact, is source-grep only, or does not map to written AC ids.
67
+ 5. The suite is happy-path-only while the Goal Contract lists empty, boundary, sibling, or error AC rows.
67
68
  - **Maker Directive**: The Maker must adopt the concrete alternative diff or provide an equivalent verified architectural resolution, authoring regression unit tests.
68
69
 
69
70
  ---
@@ -22,7 +22,7 @@ A verification `PASS` is **strictly invalid** without concrete execution evidenc
22
22
  5. **`stdout` & `stderr`**: Raw machine logs captured from execution.
23
23
  6. **`timeoutStatus`**: Must be `"COMPLETED"` (not timed out or backgrounded without completion).
24
24
  7. **`testCounts`**: Explicit counts of passed, failed, and skipped tests.
25
- 8. **`assertionEvidence`**: Specific assertion proof matching the active Goal Contract's Acceptance Criteria, observed at a named test seam.
25
+ 8. **`assertionEvidence`**: Specific assertion proof matching the active Goal Contract's Acceptance Criteria, observed at a named test seam. Must include a non-happy-path AC when the contract has a failure table. Coverage percent is not assertionEvidence.
26
26
 
27
27
  ```json
28
28
  {
@@ -61,3 +61,5 @@ The Verification Gate immediately halts and returns to the Maker if:
61
61
  - Exit code is non-zero.
62
62
  - The command was sent to the background and not verified to completion.
63
63
  - Test logs contain zero passing assertions for new acceptance criteria.
64
+ - assertionEvidence maps only to a happy path while the Goal Contract lists empty, boundary, sibling, or error AC rows.
65
+ - The only new "test" is a source grep or a coverage percentage.
@@ -22,12 +22,12 @@ Task: Implement atomic idempotency key validation and SELECT FOR UPDATE row lock
22
22
 
23
23
  ## 3. Walkthrough Artifacts
24
24
 
25
- 1. **[Goal Contract (`goal-contract.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/backend-api/payment-idempotency/goal-contract.md)**:
25
+ 1. **[Goal Contract (`goal-contract.md`)](./goal-contract.md)**:
26
26
  - AC-1: Idempotency-Key header mandatory on POST `/api/v1/payments/charge`.
27
27
  - AC-2: Atomic reservation using PostgreSQL `INSERT ... ON CONFLICT DO NOTHING`.
28
28
  - AC-3: Concurrent requests for same user wallet serialized with `SELECT ... FOR UPDATE`.
29
- 2. **[Adversarial Review Findings (`review-findings.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/backend-api/payment-idempotency/review-findings.md)**:
29
+ 2. **[Adversarial Review Findings (`review-findings.md`)](./review-findings.md)**:
30
30
  - Devil's Advocate activates `backend-api` rules (concurrency, database atomicity).
31
31
  - Flags missing rollback on external gateway timeout (`ERR-001`).
32
- 3. **[Judge Verdict (`judge-verdict.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/backend-api/payment-idempotency/judge-verdict.md)**:
32
+ 3. **[Judge Verdict (`judge-verdict.md`)](./judge-verdict.md)**:
33
33
  - Evaluates parallel test execution (`go test -race ./...`), verifies concurrency safety, and issues `PASS` verdict.
@@ -0,0 +1,23 @@
1
+ # Reference Example: Request Display Status Fix
2
+
3
+ ## 1. Context & Scenario
4
+
5
+ This walkthrough shows how a status-display bug moves through the **AI Engineering Loop** and the **DOT Delivery Adapter**. Names, URLs, and schema below are **fictional**. Do not copy real client tickets, GitLab links, or field names into this package.
6
+
7
+ ### The Problem
8
+
9
+ On an employee portal, request cards on the list and pagination endpoints showed `"PENDING"` after every line item was already approved or rejected. Non-standard-window records were also scored with the standard-day rule.
10
+
11
+ ---
12
+
13
+ ## 2. Walkthrough Stages & Artifacts
14
+
15
+ 1. **[Stage 1: Goal Contract (`goal-contract.md`)](./goal-contract.md)**:
16
+ - Objective, acceptance criteria (standard window, holiday, non-standard window, null values), and verification plan.
17
+ 2. **[Stage 2: Adversarial Review & Triage (`review-findings.md`)](./review-findings.md)**:
18
+ - Devil's Advocate flags a null-safety bug (`COR-001`) and an invalid nitpick (`MAINT-001`).
19
+ - Maker triage and surgical fix.
20
+ 3. **[Stage 3: Judge Evaluation & Verdict (`judge-verdict.md`)](./judge-verdict.md)**:
21
+ - Audit of tests, typecheck, finding resolutions, and `PASS`.
22
+ 4. **[Stage 4: DOT Delivery Pipeline (`delivery-report.md`)](./delivery-report.md)**:
23
+ - Fictional issue, base MR, cherry-picks to `staging` and `develop`, Coreview triage, Mattermost notice.
@@ -0,0 +1,41 @@
1
+ # DOT Delivery Report: Request Display Status Fix
2
+
3
+ Fictional sample. Replace host, group, repo, issue, and MR ids from `glab` output. Never paste real client URLs into this package.
4
+
5
+ ## 1. Summary of Delivery Actions
6
+
7
+ 1. **GitLab Issue Created**: [Issue #42 - [BE] [Requests] Fix display status](https://gitlab.example.com/example-org/work-portal/-/issues/42).
8
+ 2. **Primary MR Created**: [MR !10 targeting `main`](https://gitlab.example.com/example-org/work-portal/-/merge_requests/10).
9
+ 3. **Multi-Branch Cherry-Pick**:
10
+ - [MR !11 targeting `staging`](https://gitlab.example.com/example-org/work-portal/-/merge_requests/11).
11
+ - [MR !12 targeting `develop`](https://gitlab.example.com/example-org/work-portal/-/merge_requests/12).
12
+ 4. **Coreview Bot Triage**:
13
+ - Comments fetched on MR !12. Zero blocking comments.
14
+ 5. **Mattermost Notification**:
15
+ - Resolved repository `example-org/work-portal` to channel `"team-work-portal"`.
16
+ - Dispatched via MCP `mattermost_send_message` with `from: "AI Agent"`.
17
+
18
+ ---
19
+
20
+ ## 2. GitLab Links
21
+
22
+ | Artifact | Branch | Link |
23
+ |---|---|---|
24
+ | **GitLab Issue** | — | [Issue #42](https://gitlab.example.com/example-org/work-portal/-/issues/42) |
25
+ | **Merge Request DEV** | `develop` | [MR !12](https://gitlab.example.com/example-org/work-portal/-/merge_requests/12) |
26
+ | **Merge Request STAGING** | `staging` | [MR !11](https://gitlab.example.com/example-org/work-portal/-/merge_requests/11) |
27
+ | **Merge Request MAIN** | `main` | [MR !10](https://gitlab.example.com/example-org/work-portal/-/merge_requests/10) |
28
+
29
+ ---
30
+
31
+ ## 3. Dispatched Mattermost Notification
32
+
33
+ ```text
34
+ [MR DEV] https://gitlab.example.com/example-org/work-portal/-/merge_requests/12
35
+ Changes log
36
+ - Include standard-window and rush-note fields when loading request list pages.
37
+ - Resolve display status from all line items, including holiday and null collections.
38
+ - Add unit tests for standard, holiday, non-standard-window, and null line-item cases.
39
+
40
+ cc: @owner
41
+ ```
@@ -0,0 +1,46 @@
1
+ # Goal Contract: Request Display Status Fix
2
+
3
+ ## 1. Objective
4
+
5
+ Fix incorrect display status on list and pagination endpoints when a request has mixed line items, holiday logs, non-standard windows, or null collections.
6
+
7
+ ## 2. Business Outcome & User Lifecycle Impact
8
+
9
+ - **Employees**: See APPROVED, REJECTED, or NEED_APPROVAL matching the real record.
10
+ - **Reviewers**: Stop getting false pending notices for already-settled holiday logs.
11
+ - **Finance**: Totals used by the downstream aggregate job stay consistent.
12
+
13
+ ## 3. Acceptance Criteria (AC)
14
+
15
+ - [ ] **AC-1**: If `hasStandardWindow = true` and `duration` is within the standard day limit on a weekday without a rush note, display status is `APPROVED` or `NEED_APPROVAL` from clock-in/out presence only.
16
+ - [ ] **AC-2**: If a rush note exists, or duration exceeds the standard limit, or `isHoliday = true`, evaluate pending status across all associated `lineItems`.
17
+ - [ ] **AC-3**: Non-standard-window records (`user.type.hasStandardWindow = false`) must not use the weekday duration threshold.
18
+ - [ ] **AC-4**: Null or missing `lineItems` default to `APPROVED` without throwing `TypeError`.
19
+ - [ ] **AC-5**: The existing API response contract is unchanged.
20
+
21
+ ## 4. Technical Constraints
22
+
23
+ - Keep the existing list/pagination query shape.
24
+ - Centralize logic in a pure function: `resolveRequestDisplayStatus`.
25
+ - No new runtime dependencies.
26
+ - `tsc --noEmit` exits 0.
27
+
28
+ ## 5. Out of Scope
29
+
30
+ - Frontend layout changes.
31
+ - Database migrations.
32
+ - Changing the downstream aggregate/export job.
33
+
34
+ ## 6. Verification Requirements
35
+
36
+ - **Unit Tests**: Jest suite at `src/server/requests/utils/resolve-display-status.test.ts`.
37
+ - **Typecheck**: `npx tsc --noEmit` exits 0.
38
+ - **Linter**: `npx eslint --fix` on modified files, 0 errors.
39
+ - **Regression**: commands in `.ai-engineering-loop/verification.md` (example: `npx jest && npx tsc --noEmit`).
40
+
41
+ ## 7. Definition of Done (DoD)
42
+
43
+ - [ ] AC-1 through AC-5 proven by unit tests.
44
+ - [ ] Deterministic verification passes.
45
+ - [ ] Devil's Advocate review with 0 unresolved blocking findings.
46
+ - [ ] Judge issues PASS.
@@ -0,0 +1,44 @@
1
+ # Judge Evaluation Report: Request Display Status Fix
2
+
3
+ ## 1. Executive Verdict
4
+
5
+ - **Verdict**: `PASS`
6
+ - **Iteration**: `Iteration 2 of 3`
7
+ - **Confidence**: `HIGH`
8
+
9
+ ---
10
+
11
+ ## 2. Deterministic Verification Audit
12
+
13
+ | Check | Command Executed | Raw Result | Status |
14
+ |---|---|---|:---:|
15
+ | **Unit Tests** | `npx jest src/server/requests/utils/resolve-display-status.test.ts` | `Tests: 12 passed, 12 total.` | PASS |
16
+ | **Full Suite** | `npx jest && npx tsc --noEmit` | `Test Suites: 12 passed. tsc exit 0.` | PASS |
17
+ | **TypeScript** | `npx tsc --noEmit` | `Exit code 0.` | PASS |
18
+ | **Linter** | `npx eslint --fix src/server/requests/**` | `0 errors.` | PASS |
19
+
20
+ ---
21
+
22
+ ## 3. Goal Contract Compliance Audit
23
+
24
+ | Criterion | Verified By Test / Artifact | Result |
25
+ |---|---|:---:|
26
+ | **AC-1**: Standard-window weekday | `resolve-display-status.test.ts > standard window` | PASS |
27
+ | **AC-2**: Holiday and over-limit handling | `resolve-display-status.test.ts > holiday rush` | PASS |
28
+ | **AC-3**: Non-standard-window records | `resolve-display-status.test.ts > non-standard window` | PASS |
29
+ | **AC-4**: Null `lineItems` | `resolve-display-status.test.ts > null safety` | PASS |
30
+ | **AC-5**: API contract | router typecheck | PASS |
31
+
32
+ ---
33
+
34
+ ## 4. Finding Triage Audit
35
+
36
+ - **COR-001 (High - Null Safety)**: Maker applied null coalescing in Iteration 2. **Status: RESOLVED & VERIFIED**.
37
+ - **MAINT-001 (Low - Factory Suggestion)**: Invalid speculative nitpick. **Status: DISMISSED / INVALID**.
38
+
39
+ ---
40
+
41
+ ## 5. Formal Conclusion & Hand-off
42
+
43
+ Definition of Done is met with reproducible evidence.
44
+ **Authorized next action**: DOT Delivery Adapter (`adapters/dot/README.md`) for GitLab MR, multi-branch cherry-pick, Coreview triage, and Mattermost.
@@ -0,0 +1,63 @@
1
+ # Adversarial Review Findings & Triage: Request Display Status Fix
2
+
3
+ ## 1. Review Summary
4
+
5
+ - **Reviewer**: Devil's Advocate Agent
6
+ - **Target Branch**: `main...fix/request-display-status`
7
+ - **Total Findings**: 2
8
+ - **Blocking (SEV-1/2)**: 1
9
+ - **Non-Blocking / Invalid**: 1
10
+
11
+ ---
12
+
13
+ ## 2. Findings Ledger
14
+
15
+ ### Finding COR-001: Missing null safety when iterating `lineItems`
16
+
17
+ - **Severity**: `HIGH` (SEV-2)
18
+ - **Category**: `Correctness`
19
+ - **Location**: `src/server/requests/utils/resolve-display-status.ts:34-41`
20
+ - **Evidence**:
21
+
22
+ ```typescript
23
+ const hasPending = confirmation.lineItems.some(
24
+ (item) => item.status === "NEED_APPROVAL"
25
+ );
26
+ ```
27
+
28
+ - **Problem**:
29
+ If `confirmation.lineItems` is `null` or `undefined` (legacy rows), `.some()` throws `TypeError`.
30
+ - **Impact**:
31
+ Pagination API crashes for historical records.
32
+ - **Recommendation**:
33
+
34
+ ```diff
35
+ - const hasPending = confirmation.lineItems.some(
36
+ + const hasPending = (confirmation.lineItems ?? []).some(
37
+ (item) => item.status === "NEED_APPROVAL"
38
+ );
39
+ ```
40
+
41
+ - **Confidence**: `HIGH`
42
+ - **Status**: `TRIAGED_VALID`
43
+ - **Resolution**:
44
+ Maker applied `(confirmation.lineItems ?? [])` and added `should return APPROVED when lineItems is null or undefined`.
45
+
46
+ ---
47
+
48
+ ### Finding MAINT-001: Suggestion to convert helper into an abstract factory class
49
+
50
+ - **Severity**: `LOW` (SEV-4)
51
+ - **Category**: `Maintainability`
52
+ - **Location**: `src/server/requests/utils/resolve-display-status.ts:1-50`
53
+ - **Evidence**:
54
+ Utility is `export function resolveRequestDisplayStatus(...)`.
55
+ - **Problem**:
56
+ Reviewer wanted a Strategy/Factory for future calculator swaps.
57
+ - **Impact**:
58
+ None. Pure functions match this repo.
59
+ - **Recommendation**: Refactor to `class StatusCalculatorFactory`.
60
+ - **Confidence**: `LOW`
61
+ - **Status**: `TRIAGED_INVALID`
62
+ - **Triage Reason**:
63
+ Speculative overengineering. Constraint: surgical change, no extra abstractions.
@@ -13,7 +13,7 @@ This walkthrough demonstrates how the **AI Engineering Loop** automatically init
13
13
 
14
14
  ## 2. Walkthrough Artifacts
15
15
 
16
- 1. **[Discovery Execution Trace (`discovery-trace.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/initialization/discovery-trace.md)**:
16
+ 1. **[Discovery Execution Trace (`discovery-trace.md`)](./discovery-trace.md)**:
17
17
  - Full 5-pass log of directory inspection, manifest parsing, script discovery, architecture tracing, and second-pass quality check.
18
- 2. **[Generated Context Artifacts (`generated-context.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/initialization/generated-context.md)**:
18
+ 2. **[Generated Context Artifacts (`generated-context.md`)](./generated-context.md)**:
19
19
  - The exact evidence-based `.ai-engineering-loop/` files generated automatically by the agent without user intervention.
@@ -18,7 +18,7 @@
18
18
  - `packages/` (contains `ui/`, `database/`, `shared/`)
19
19
  - `pnpm-workspace.yaml` (detected `pnpm` monorepo)
20
20
  - `turbo.json` (detected Turborepo pipeline)
21
- - **Profile Binding**: Bound [`profiles/monorepo.md`](file:///Users/egagofur/Development/work/ai-engineering-loop/profiles/monorepo.md).
21
+ - **Profile Binding**: Bound [`profiles/monorepo.md`](../../profiles/monorepo.md).
22
22
 
23
23
  ### Pass 2: Manifests & Verification Commands Discovery
24
24
  - Parsed `package.json` (root):
@@ -22,12 +22,12 @@ Task: Implement persistent offline SQLite mutation queue with exponential backof
22
22
 
23
23
  ## 3. Walkthrough Artifacts
24
24
 
25
- 1. **[Goal Contract (`goal-contract.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/mobile-app/offline-sync-queue/goal-contract.md)**:
25
+ 1. **[Goal Contract (`goal-contract.md`)](./goal-contract.md)**:
26
26
  - AC-1: All form submissions persist immediately to local SQLite `mutation_queue` table before network dispatch.
27
27
  - AC-2: Background sync engine triggers on network restoration with exponential backoff.
28
28
  - AC-3: OS suspension / app kill must not drop un-synced items.
29
- 2. **[Adversarial Review Findings (`review-findings.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/mobile-app/offline-sync-queue/review-findings.md)**:
29
+ 2. **[Adversarial Review Findings (`review-findings.md`)](./review-findings.md)**:
30
30
  - Devil's Advocate activates `mobile-app` rules (offline persistence, lifecycle, battery).
31
31
  - Flags missing disk write error handling when device storage is full (`PERF-001`).
32
- 3. **[Judge Verdict (`judge-verdict.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/mobile-app/offline-sync-queue/judge-verdict.md)**:
32
+ 3. **[Judge Verdict (`judge-verdict.md`)](./judge-verdict.md)**:
33
33
  - Audits Flutter unit & mock network tests, verifies 100% pass, and issues `PASS` verdict.
package/lib/sync-hosts.js CHANGED
@@ -33,6 +33,7 @@ function hostFileMap(home) {
33
33
  root: claude,
34
34
  files: [
35
35
  { src: '.claude/skills/ai-engineering-loop/SKILL.md', dest: path.join(claude, 'skills/ai-engineering-loop/SKILL.md'), mode: 'upsert' },
36
+ { src: 'adapters/dot/skills/task-impact-inquiry/SKILL.md', dest: path.join(claude, 'skills/task-impact-inquiry/SKILL.md'), mode: 'upsert' },
36
37
  { src: '.claude/agents/devil-advocate.md', dest: path.join(claude, 'agents/devil-advocate.md'), mode: 'upsert' },
37
38
  { src: '.claude/agents/judge.md', dest: path.join(claude, 'agents/judge.md'), mode: 'upsert' },
38
39
  { src: '.claude/commands/ai-engineering-loop.md', dest: path.join(claude, 'commands/ai-engineering-loop.md'), mode: 'upsert' }
@@ -43,6 +44,7 @@ function hostFileMap(home) {
43
44
  root: grok,
44
45
  files: [
45
46
  { src: '.grok/skills/ai-engineering-loop/SKILL.md', dest: path.join(grok, 'skills/ai-engineering-loop/SKILL.md'), mode: 'upsert', grokSkillOverlay: true },
47
+ { src: 'adapters/dot/skills/task-impact-inquiry/SKILL.md', dest: path.join(grok, 'skills/task-impact-inquiry/SKILL.md'), mode: 'upsert', grokSkillOverlay: true },
46
48
  { src: '.grok/agents/devil-advocate.md', dest: path.join(grok, 'agents/devil-advocate.md'), mode: 'upsert' },
47
49
  { src: '.grok/agents/judge.md', dest: path.join(grok, 'agents/judge.md'), mode: 'upsert' },
48
50
  { src: '.grok/commands/ai-engineering-loop.md', dest: path.join(grok, 'commands/ai-engineering-loop.md'), mode: 'upsert' }
@@ -52,7 +54,8 @@ function hostFileMap(home) {
52
54
  id: 'gemini',
53
55
  root: gemini,
54
56
  files: [
55
- { src: '.gemini/skills/ai-engineering-loop/SKILL.md', dest: path.join(gemini, 'config/skills/ai-engineering-loop/SKILL.md'), mode: 'upsert' }
57
+ { src: '.gemini/skills/ai-engineering-loop/SKILL.md', dest: path.join(gemini, 'config/skills/ai-engineering-loop/SKILL.md'), mode: 'upsert' },
58
+ { src: 'adapters/dot/skills/task-impact-inquiry/SKILL.md', dest: path.join(gemini, 'config/skills/task-impact-inquiry/SKILL.md'), mode: 'upsert' }
56
59
  ]
57
60
  },
58
61
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-engineering-loop",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "A reusable, framework-agnostic AI Engineering Operating System for autonomous coding agents.",
5
5
  "main": "bin/ai-engineering-loop.js",
6
6
  "bin": {