This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: eng-harness-in-a-box | |
| description: | | |
| The engineering-harness loop with zero dependencies — an engineering harness in a box. | |
| Use in any repo, especially one with no harness yet: find or establish a | |
| focal operating surface, name the deterministic proof before working, | |
| capture friction as you go, and offer one encodable improvement at the end. | |
| Advisory always — the user is never blocked, the agent is never silent. | |
| When a repo has an installed harness CLI and wants the full loop, use | |
| eng-harness-flow instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>pij — the deterministic layer</title> | |
| <style> | |
| :root{ | |
| --paper:#F3F6F4; | |
| --card:#FFFFFF; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| # Test doubles implement the same interfaces as production code | |
| class FakeBookingRepository(BookingRepository): | |
| """In-memory repository for testing - no HTTP, no database.""" | |
| def __init__(self): | |
| self._bookings: dict[str, Booking] = {} | |
| def find_by_id(self, booking_id: BookingId) -> Booking | None: | |
| return self._bookings.get(booking_id.value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Interface lives in the application/domain module | |
| from abc import ABC, abstractmethod | |
| from typing import Optional | |
| import httpx | |
| class BookingRepository(ABC): | |
| @abstractmethod | |
| async def find_by_id(self, booking_id: BookingId) -> Optional["Booking"]: | |
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from dataclasses import dataclass | |
| from datetime import datetime | |
| from abc import ABC, abstractmethod | |
| # Domain command + IDs used at the boundary of the application layer | |
| @dataclass | |
| class BookingId: | |
| value: str | |
| @dataclass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| # Test doubles implement the same interfaces as production code | |
| class FakeBookingRepository(BookingRepository): | |
| """In-memory repository for testing - no HTTP, no database.""" | |
| def __init__(self): | |
| self._bookings: dict[str, Booking] = {} | |
| def find_by_id(self, booking_id: BookingId) -> Booking | None: | |
| return self._bookings.get(booking_id.value) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Interface visible to application services | |
| from abc import ABC, abstractmethod | |
| from dataclasses import dataclass | |
| class PaymentAdapter(ABC): | |
| @abstractmethod | |
| async def charge(self, request: "PaymentRequest") -> "PaymentResult": | |
| pass | |
| # Domain-facing request/result types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Interface lives in the application/domain module | |
| from abc import ABC, abstractmethod | |
| from typing import Optional | |
| import httpx | |
| class BookingRepository(ABC): | |
| @abstractmethod | |
| async def find_by_id(self, booking_id: BookingId) -> Optional["Booking"]: | |
| pass |
NewerOlder