ai-engineering-loop 1.0.14 → 1.0.16
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.
- package/.agents/workflows/ai-engineering-loop.md +2 -2
- package/.claude/commands/ai-engineering-loop.md +1 -1
- package/.claude/skills/ai-engineering-loop/SKILL.md +4 -3
- package/.gemini/skills/ai-engineering-loop/SKILL.md +4 -3
- package/.grok/commands/ai-engineering-loop.md +1 -1
- package/.grok/skills/ai-engineering-loop/SKILL.md +4 -4
- package/README.md +16 -10
- package/adapters/README.md +27 -0
- package/adapters/dot/README.md +8 -8
- package/adapters/dot/coreview.md +3 -2
- package/adapters/dot/gitlab.md +3 -3
- package/adapters/dot/mattermost.md +59 -71
- package/adapters/dot/multi-branch.md +3 -2
- package/adapters/dot/skills/dot-dev-workflow/SKILL.md +2 -2
- package/adapters/dot/skills/task-impact-inquiry/SKILL.md +155 -0
- package/adapters/generate-adapter/SKILL.md +123 -0
- package/adapters/github/README.md +28 -0
- package/adapters/github/pull-request.md +23 -0
- package/adapters/gitlab/README.md +28 -0
- package/adapters/gitlab/merge-request.md +26 -0
- package/adapters/standard/README.md +44 -0
- package/bin/ai-engineering-loop.js +31 -3
- package/core/grill-policy.md +14 -10
- package/core/repo-config-schema.md +1 -1
- package/examples/backend-api/payment-idempotency/README.md +3 -3
- package/examples/dot/status-display/README.md +23 -0
- package/examples/dot/status-display/delivery-report.md +41 -0
- package/examples/dot/status-display/goal-contract.md +46 -0
- package/examples/dot/status-display/judge-verdict.md +44 -0
- package/examples/dot/status-display/review-findings.md +63 -0
- package/examples/initialization/README.md +2 -2
- package/examples/initialization/discovery-trace.md +1 -1
- package/examples/mobile-app/offline-sync-queue/README.md +3 -3
- package/lib/generate-adapter.js +118 -0
- package/lib/sync-hosts.js +7 -1
- package/package.json +1 -1
- package/templates/repo-config/adapter.md +1 -1
- package/tests/generate-adapter.test.js +80 -0
- package/tests/no-company-leak.test.js +82 -0
- package/tests/skill-host-compat.test.js +45 -7
- package/tests/sync-hosts.test.js +33 -1
- package/examples/dot/attendance-confirmation/README.md +0 -22
- package/examples/dot/attendance-confirmation/delivery-report.md +0 -51
- package/examples/dot/attendance-confirmation/goal-contract.md +0 -39
- package/examples/dot/attendance-confirmation/judge-verdict.md +0 -43
- package/examples/dot/attendance-confirmation/review-findings.md +0 -57
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Reference Example: Attendance Confirmation Status Fix
|
|
2
|
-
|
|
3
|
-
## 1. Context & Scenario
|
|
4
|
-
|
|
5
|
-
This reference walkthrough demonstrates how a complex real-world bug in the DOT ecosystem moves through the complete **AI Engineering Loop** and is subsequently delivered via the **DOT Delivery Adapter**.
|
|
6
|
-
|
|
7
|
-
### The Problem
|
|
8
|
-
In the Dotify employee portal, attendance confirmation cards displayed an incorrect status (`"PENDING"`) for employees working overtime or on weekends, even when all underlying time logs had already been approved or rejected. Furthermore, non-normal hours employees (shift workers) had their records mistakenly treated under standard 9-to-5 rules.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## 2. Walkthrough Stages & Artifacts
|
|
13
|
-
|
|
14
|
-
1. **[Stage 1: Goal Contract (`goal-contract.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/dot/attendance-confirmation/goal-contract.md)**:
|
|
15
|
-
- Formalized objective, acceptance criteria (normal hours, weekends, non-normal hours, null values), and verification plan.
|
|
16
|
-
2. **[Stage 2: Adversarial Review & Triage (`review-findings.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/dot/attendance-confirmation/review-findings.md)**:
|
|
17
|
-
- Independent Devil's Advocate review flagging a timezone offset bug (`COR-001`) and an invalid nitpick (`MAINT-001`).
|
|
18
|
-
- Maker Agent triage and surgical resolution.
|
|
19
|
-
3. **[Stage 3: Judge Evaluation & Verdict (`judge-verdict.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/dot/attendance-confirmation/judge-verdict.md)**:
|
|
20
|
-
- Audit of unit test results, typecheck logs, finding resolutions, and issuance of `PASS` verdict.
|
|
21
|
-
4. **[Stage 4: DOT Delivery Pipeline (`delivery-report.md`)](file:///Users/egagofur/Development/work/ai-engineering-loop/examples/dot/attendance-confirmation/delivery-report.md)**:
|
|
22
|
-
- Creation of GitLab Issue #307, base MR !946, multi-branch propagation to `staging` (!947) and `develop` (!948), Coreview bot triage, and automated Mattermost channel notification.
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# DOT Delivery Report: Attendance Confirmation Fix
|
|
2
|
-
|
|
3
|
-
## 1. Summary of Delivery Actions
|
|
4
|
-
|
|
5
|
-
Upon receiving the `PASS` verdict from the Judge Agent, the DOT Delivery Adapter executed the following release actions:
|
|
6
|
-
|
|
7
|
-
1. **GitLab Issue Created**: [Issue #307 - [BE] [Attendance] Fix Attendance Confirmation Display Status](https://gitlab.dot.co.id/dot-system/dotify-new/-/issues/307).
|
|
8
|
-
2. **Primary MR Created**: [MR !946 targeting `main`](https://gitlab.dot.co.id/dot-system/dotify-new/-/merge_requests/946).
|
|
9
|
-
3. **Multi-Branch Cherry-Pick**:
|
|
10
|
-
- [MR !947 targeting `staging`](https://gitlab.dot.co.id/dot-system/dotify-new/-/merge_requests/947).
|
|
11
|
-
- [MR !948 targeting `develop`](https://gitlab.dot.co.id/dot-system/dotify-new/-/merge_requests/948).
|
|
12
|
-
4. **Coreview Bot Triage**:
|
|
13
|
-
- Comments fetched on MR !948. Zero blocking comments found.
|
|
14
|
-
5. **Mattermost Notification**:
|
|
15
|
-
- Resolved repository `dot-system/dotify-new` to channel `"internal-dotify"`.
|
|
16
|
-
- Dispatched Markdown report 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 #307](https://gitlab.dot.co.id/dot-system/dotify-new/-/issues/307)` |
|
|
25
|
-
| **Merge Request DEV** | `develop` | `[MR !948](https://gitlab.dot.co.id/dot-system/dotify-new/-/merge_requests/948)` |
|
|
26
|
-
| **Merge Request STAGING** | `staging` | `[MR !947](https://gitlab.dot.co.id/dot-system/dotify-new/-/merge_requests/947)` |
|
|
27
|
-
| **Merge Request MAIN** | `main` | `[MR !946](https://gitlab.dot.co.id/dot-system/dotify-new/-/merge_requests/946)` |
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## 3. Dispatched Mattermost Notification
|
|
32
|
-
|
|
33
|
-
```text
|
|
34
|
-
[MR DEV] https://gitlab.dot.co.id/dot-system/dotify-new/-/merge_requests/948
|
|
35
|
-
Changes log
|
|
36
|
-
- Include user.type.hasNormalHours and timeEntities.overtimeNote in attendanceConfirmationPagination Prisma query.
|
|
37
|
-
- Create resolveAttendanceConfirmationDisplayStatus utility to properly evaluate hasPendingTimeEntities by checking overtimeNote, isWeekend, duration > 8, non-normal hours employees, and null statuses.
|
|
38
|
-
- Add comprehensive unit tests in src/server/attendance-confirmations/utils/resolve-display-status.test.ts covering all status permutations.
|
|
39
|
-
|
|
40
|
-
[MR STAGING] https://gitlab.dot.co.id/dot-system/dotify-new/-/merge_requests/947
|
|
41
|
-
Changes log
|
|
42
|
-
- Include user.type.hasNormalHours and timeEntities.overtimeNote in attendanceConfirmationPagination Prisma query.
|
|
43
|
-
- Create resolveAttendanceConfirmationDisplayStatus utility to properly evaluate hasPendingTimeEntities by checking overtimeNote, isWeekend, duration > 8, non-normal hours employees, and null statuses.
|
|
44
|
-
- Add comprehensive unit tests in src/server/attendance-confirmations/utils/resolve-display-status.test.ts covering all status permutations.
|
|
45
|
-
|
|
46
|
-
[MR MAIN] https://gitlab.dot.co.id/dot-system/dotify-new/-/merge_requests/946
|
|
47
|
-
Changes log
|
|
48
|
-
- Include user.type.hasNormalHours and timeEntities.overtimeNote in attendanceConfirmationPagination Prisma query.
|
|
49
|
-
- Create resolveAttendanceConfirmationDisplayStatus utility to properly evaluate hasPendingTimeEntities by checking overtimeNote, isWeekend, duration > 8, non-normal hours employees, and null statuses.
|
|
50
|
-
- Add comprehensive unit tests in src/server/attendance-confirmations/utils/resolve-display-status.test.ts covering all status permutations.
|
|
51
|
-
```
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# Goal Contract: Attendance Confirmation Display Status Fix
|
|
2
|
-
|
|
3
|
-
## 1. Objective
|
|
4
|
-
Fix the incorrect calculation of attendance confirmation display statuses across list and pagination endpoints when time entities contain overtime notes, weekend logs, non-normal hours employees, or null record states.
|
|
5
|
-
|
|
6
|
-
## 2. Business Outcome & User Lifecycle Impact
|
|
7
|
-
- **Employees**: View accurate confirmation statuses (APPROVED, REJECTED, NEED_APPROVAL) reflecting their true attendance record.
|
|
8
|
-
- **Managers / Reviewers**: Stop receiving false-positive pending approval notifications for already-settled weekend logs.
|
|
9
|
-
- **HR & Payroll**: Accurate cumulative duration calculations for payroll export.
|
|
10
|
-
|
|
11
|
-
## 3. Acceptance Criteria (AC)
|
|
12
|
-
- [ ] **AC-1**: If an employee has `hasNormalHours = true` and `duration <= 8` on a standard weekday without overtime notes, display status must resolve to `APPROVED` or `NEED_APPROVAL` strictly based on clock-in/out presence.
|
|
13
|
-
- [ ] **AC-2**: If `overtimeNote` exists or `duration > 8` or `isWeekend = true`, evaluate pending status across all associated `timeEntities`.
|
|
14
|
-
- [ ] **AC-3**: Non-normal hours employees (`user.type.hasNormalHours = false`) must not be evaluated under 8-hour weekday thresholds.
|
|
15
|
-
- [ ] **AC-4**: Null or missing time entity collections must default safely to `APPROVED` without throwing runtime `TypeError`.
|
|
16
|
-
- [ ] **AC-5**: Backward compatibility of the tRPC/REST response contract must be strictly preserved.
|
|
17
|
-
|
|
18
|
-
## 4. Technical Constraints
|
|
19
|
-
- Preserve existing Prisma query schemas in `attendanceConfirmationPagination`.
|
|
20
|
-
- Centralize logic in a pure, testable utility function: `resolveAttendanceConfirmationDisplayStatus`.
|
|
21
|
-
- No new external runtime dependencies (use existing `dayjs` and `lodash` packages).
|
|
22
|
-
- 0 TypeScript compiler errors on `tsc --noEmit`.
|
|
23
|
-
|
|
24
|
-
## 5. Out of Scope
|
|
25
|
-
- Modifying the UI frontend component layouts in `dotify-new/web`.
|
|
26
|
-
- Database schema migrations or alter table statements.
|
|
27
|
-
- Changing payroll export report generation scripts.
|
|
28
|
-
|
|
29
|
-
## 6. Verification Requirements
|
|
30
|
-
- **Unit Tests**: Comprehensive Jest test suite in `src/server/attendance-confirmations/utils/resolve-display-status.test.ts` covering 100% of branches.
|
|
31
|
-
- **Typecheck**: `npx tsc --noEmit` exits with 0.
|
|
32
|
-
- **Linter**: `npx eslint --fix` on modified files with 0 errors.
|
|
33
|
-
- **Regression**: Run entire test suite: `npx jest --testPathIgnorePatterns="dotify-api"`.
|
|
34
|
-
|
|
35
|
-
## 7. Definition of Done (DoD)
|
|
36
|
-
- [ ] All AC-1 through AC-5 proven by unit tests.
|
|
37
|
-
- [ ] Deterministic verification passes 100%.
|
|
38
|
-
- [ ] Devil's Advocate review conducted with 0 unresolved blocking findings.
|
|
39
|
-
- [ ] Judge issues PASS verdict.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# Judge Evaluation Report: Attendance Confirmation Fix
|
|
2
|
-
|
|
3
|
-
## 1. Executive Verdict
|
|
4
|
-
- **Verdict**: `PASS`
|
|
5
|
-
- **Iteration**: `Iteration 2 of 3`
|
|
6
|
-
- **Confidence**: `HIGH`
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## 2. Deterministic Verification Audit
|
|
11
|
-
|
|
12
|
-
| Check | Command Executed | Raw Result | Status |
|
|
13
|
-
|---|---|---|:---:|
|
|
14
|
-
| **Unit Tests** | `npx jest src/server/attendance-confirmations/utils/resolve-display-status.test.ts` | `Tests: 12 passed, 12 total. Snapshots: 0. Time: 1.42s` | ✅ PASS |
|
|
15
|
-
| **Full Suite** | `npx jest --testPathIgnorePatterns="dotify-api"` | `Test Suites: 48 passed, 48 total. Tests: 382 passed.` | ✅ PASS |
|
|
16
|
-
| **TypeScript** | `npx tsc --noEmit` | `Exit code 0. Zero errors.` | ✅ PASS |
|
|
17
|
-
| **Linter** | `npx eslint --fix src/server/attendance-confirmations/**` | `0 errors, 0 warnings found.` | ✅ PASS |
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## 3. Goal Contract Compliance Audit
|
|
22
|
-
|
|
23
|
-
| Criterion | Verified By Test / Artifact | Result |
|
|
24
|
-
|---|---|:---:|
|
|
25
|
-
| **AC-1**: Normal hours weekday calculation | `resolve-display-status.test.ts > normal hours` | ✅ PASS |
|
|
26
|
-
| **AC-2**: Weekend & duration > 8 handling | `resolve-display-status.test.ts > weekend overtime` | ✅ PASS |
|
|
27
|
-
| **AC-3**: Non-normal hours employee rules | `resolve-display-status.test.ts > shift worker` | ✅ PASS |
|
|
28
|
-
| **AC-4**: Null & undefined timeEntities safety | `resolve-display-status.test.ts > null safety` | ✅ PASS |
|
|
29
|
-
| **AC-5**: API Contract Preservation | `tRPC router typecheck` | ✅ PASS |
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## 4. Finding Triage Audit
|
|
34
|
-
|
|
35
|
-
- **COR-001 (High - Null Safety)**: Maker applied null coalescing in Iteration 2. Verified via fresh test execution. **Status: RESOLVED & VERIFIED**.
|
|
36
|
-
- **MAINT-001 (Low - Factory Suggestion)**: Overridden by Judge as invalid speculative nitpick. **Status: DISMISSED / INVALID**.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## 5. Formal Conclusion & Hand-off
|
|
41
|
-
|
|
42
|
-
The Definition of Done has been 100% satisfied with reproducible evidence.
|
|
43
|
-
**Authorized next action**: Proceed to [DOT Delivery Adapter](file:///Users/egagofur/Development/work/ai-engineering-loop/adapters/dot/README.md) for GitLab MR generation, multi-branch cherry-picking, Coreview triage, and Mattermost notification.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Adversarial Review Findings & Triage: Attendance Confirmation Fix
|
|
2
|
-
|
|
3
|
-
## 1. Review Summary
|
|
4
|
-
|
|
5
|
-
- **Reviewer**: Devil's Advocate Agent
|
|
6
|
-
- **Target Branch**: `main...fix/attendance-confirmation-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 `timeEntities`
|
|
16
|
-
- **Severity**: `HIGH` (SEV-2)
|
|
17
|
-
- **Category**: `Correctness`
|
|
18
|
-
- **Location**: `src/server/attendance-confirmations/utils/resolve-display-status.ts:34-41`
|
|
19
|
-
- **Evidence**:
|
|
20
|
-
```typescript
|
|
21
|
-
const hasPending = confirmation.timeEntities.some(
|
|
22
|
-
(entity) => entity.status === "NEED_APPROVAL"
|
|
23
|
-
);
|
|
24
|
-
```
|
|
25
|
-
- **Problem**:
|
|
26
|
-
If `confirmation.timeEntities` is `null` or `undefined` (which occurs for historical attendance records prior to migration v2.4), calling `.some()` throws a runtime `TypeError: Cannot read properties of undefined (reading 'some')`.
|
|
27
|
-
- **Impact**:
|
|
28
|
-
Crashing pagination API for employees with legacy historical attendance records.
|
|
29
|
-
- **Recommendation**:
|
|
30
|
-
```diff
|
|
31
|
-
- const hasPending = confirmation.timeEntities.some(
|
|
32
|
-
+ const hasPending = (confirmation.timeEntities ?? []).some(
|
|
33
|
-
(entity) => entity.status === "NEED_APPROVAL"
|
|
34
|
-
);
|
|
35
|
-
```
|
|
36
|
-
- **Confidence**: `HIGH`
|
|
37
|
-
- **Status**: `TRIAGED_VALID`
|
|
38
|
-
- **Resolution**:
|
|
39
|
-
Maker Agent applied optional chaining and null coalescing `(confirmation.timeEntities ?? [])` and added unit test case `should return APPROVED when timeEntities is null or undefined` in `resolve-display-status.test.ts`.
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
### Finding MAINT-001: Suggestion to convert helper into an abstract factory class
|
|
44
|
-
- **Severity**: `LOW` (SEV-4)
|
|
45
|
-
- **Category**: `Maintainability`
|
|
46
|
-
- **Location**: `src/server/attendance-confirmations/utils/resolve-display-status.ts:1-50`
|
|
47
|
-
- **Evidence**:
|
|
48
|
-
Utility is authored as a pure exported function `export function resolveAttendanceConfirmationDisplayStatus(...)`.
|
|
49
|
-
- **Problem**:
|
|
50
|
-
Reviewer claimed that an object-oriented Strategy/Factory pattern would allow swapping attendance status calculators in the future.
|
|
51
|
-
- **Impact**:
|
|
52
|
-
None. Pure functions are more testable, tree-shakeable, and align with current repository conventions.
|
|
53
|
-
- **Recommendation**: Refactor to `class AttendanceStatusCalculatorFactory`.
|
|
54
|
-
- **Confidence**: `LOW`
|
|
55
|
-
- **Status**: `TRIAGED_INVALID`
|
|
56
|
-
- **Triage Reason**:
|
|
57
|
-
Dismissed as speculative overengineering. Repository architecture uses functional utilities with tRPC. Adding a class factory violates Technical Constraint: *"Produce minimal, surgical changes without speculative abstractions."*
|