Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions conventions/review/overlays/bash.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,32 @@ brings it under ShellCheck.
`code-quality.md` owns the god-file and embedded-script bars. See the
[Google shell style guide][6] on when to use shell.

## Date and time

The shared [date-time criteria](../date-time.md) own the semantic and storage
contract. This overlay owns only what a shell script should do itself.

- **Keep portable output explicit and UTC** — for a portable current timestamp,
use a fixed locale and POSIX `date`, for example
`LC_ALL=C date -u '+%Y-%m-%dT%H:%M:%SZ'`. GNU `date -d`, `--iso-8601`,
`--rfc-3339`, `%N`, and `%:z` are extensions; each use needs a declared,
tested compatible runtime rather than being treated as POSIX-portable. See
Comment thread
kyle-sexton marked this conversation as resolved.
Resolved
POSIX [`date`][10] and GNU's [option][11] and [format guidance][12].
- **Do not make `date` a business-calendar engine** — reject natural-language
input and ambiguous abbreviations on correctness-critical paths. Parsing,
named-zone conversion, recurrence, or civil-time arithmetic belongs in a
structured runtime with a documented time-zone library once it passes the
shell threshold.
- **Do not inherit the machine's local zone** — when local reporting is truly
required on a known platform, set `TZ` for the individual command and verify
that the deployed system contains the requested IANA data. `TZ` chooses the
conversion context; it does not make a missing database appear. Otherwise use
`-u`.
- **Delegate elapsed-time correctness** — portable shell has no standard
monotonic-clock interface. A timeout, retry budget, or deadline whose
correctness must survive wall-clock adjustment belongs in a runtime with a
documented monotonic API, not arithmetic over `date` output.

## Testing

- **Tests for non-trivial scripts** — a script with real branching, parsing, or a
Expand All @@ -96,3 +122,6 @@ brings it under ShellCheck.
[7]: https://mywiki.wooledge.org/BashPitfalls
[8]: https://github.com/koalaman/shellcheck/wiki/SC2115
[9]: https://github.com/bats-core/bats-core
[10]: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/date.html
[11]: https://www.gnu.org/software/coreutils/manual/html_node/Options-for-date.html
[12]: https://www.gnu.org/software/coreutils/manual/html_node/General-date-syntax.html
32 changes: 32 additions & 0 deletions conventions/review/overlays/containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,32 @@ Apply this overlay to Dockerfiles, Compose definitions, deployment manifests, im
- **Credential-bearing agent images are security-sensitive** — an image that can receive source-control, model-provider, browser-session, or automation credentials is reviewed as a production security boundary even when the surrounding workflow is internal or experimental.
- **Logs preserve the boundary** — runtime and audit logs are available outside the container, exclude sensitive values, and identify the immutable image revision. A container's writable filesystem is not the only copy of operational evidence.

## Date and time

The shared [date-time criteria](../date-time.md) own application semantics. This
overlay owns the runtime data and clock boundary that makes those semantics
work in a container.

- **Ship the zone database the application expects** — when code loads named
zones, the final image contains a maintained OS `tzdata` package or the
runtime's reviewed embedded equivalent. `TZ` selects a zone; it does not add
the zoneinfo files. Test at least one required zone and offset transition in
the final image, especially for slim, distroless, and `scratch` images. The
[IANA database][1] and glibc [`TZ` documentation][2] define the data and lookup
model.
- **Give tzdb an update path** — record whether rules come from the base image,
a package, or a language runtime, then rebuild and test when that source ships
an update. IANA releases have no fixed schedule and normally reach clients
through OS or runtime updates; Docker likewise recommends [regular rebuilds
with updated dependencies][3]. An immutable image with no rebuild trigger can
carry politically obsolete rules indefinitely.
- **Leave Linux clock synchronization to the node** — Linux time namespaces do
not virtualize `CLOCK_REALTIME`; keep `SYS_TIME` dropped and do not run an NTP
daemon in an application container. Make host or node synchronization and
skew monitoring an operational dependency instead. See the Linux [time
namespace documentation][4] and Docker's [`SYS_TIME` capability
description][5].

## Verification evidence

- **Scan the artifact that will run** — source dependency results and a base-image scan do not establish the contents of the final image. Review expects results for the built artifact identified by immutable digest, with findings triaged under the repository's vulnerability policy.
Expand All @@ -43,3 +69,9 @@ Apply this overlay to Dockerfiles, Compose definitions, deployment manifests, im
- [Docker seccomp profiles](https://docs.docker.com/engine/security/seccomp/)
- [Docker rootless mode](https://docs.docker.com/engine/security/rootless/)
- [OWASP Docker Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html)

[1]: https://www.iana.org/time-zones
[2]: https://sourceware.org/glibc/manual/latest/html_node/TZ-Variable.html
[3]: https://docs.docker.com/build/building/best-practices/#rebuild-your-images-often
[4]: https://man7.org/linux/man-pages/man7/time_namespaces.7.html
[5]: https://docs.docker.com/engine/containers/run/#runtime-privilege-and-linux-capabilities
39 changes: 39 additions & 0 deletions conventions/review/overlays/dotnet.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,37 @@ Stack-specific review bars for .NET that the agnostic review criteria leave to a
- **Async-void** — `async void` is the fire-and-forget-shaped signature the base criterion restricts to the platform's event-handler case; everything else returns a `Task`.
- **Library await configuration** — the analyzer already forces every await to be configured (the `dotnet-analysis` component posture); review owns what it cannot decide: the configuration fits the context (library code avoids capturing the synchronization context), and the bar still holds in repos that deliberately relaxed the rule.

## Date and time

The shared [date-time criteria](../date-time.md) own the semantic and storage
contract. This overlay owns only the .NET and SQL Server representation.

- **Types match the contract** — represent an instant with `DateTimeOffset`,
normalizing it to UTC when the shared storage contract requires that; use a
UTC `DateTime` only behind an enforced `Kind.Utc` invariant. On targets that
provide them, use `DateOnly` and `TimeOnly` for date-only and time-of-day
values (`DateOnly` and `TimeOnly` are not available in .NET Framework). Use
`TimeZoneInfo`, not the obsolete `TimeZone`, for zone conversion, and retain
the IANA zone ID separately for future local intent: a `DateTimeOffset`
carries an offset, not a time zone. Prove ID resolution on every target;
Windows IANA lookup starts with .NET 6 and requires ICU rather than NLS or
invariant globalization. See Microsoft's [type-selection guidance][1] and
[`TimeZoneInfo` compatibility notes][6].
- **Inject the clock** — time-dependent services receive a `TimeProvider` and
use its timestamp APIs for elapsed time so tests can control wall time and
timers. It is built into .NET 8 and later; .NET 5–7, .NET Framework 4.6.2 and
later, and .NET Standard 2.0 use the official compatibility package. See the
[`TimeProvider` overview][2].
- **Modern SQL Server columns** — for SQL Server and Azure SQL, select `date`,
`time`, `datetime2`, or `datetimeoffset` by contract; a new legacy `datetime`
column is an Important finding because Microsoft says to avoid it for new
work. Use `datetime2` when an offset need not round-trip and `datetimeoffset`
only when the numeric offset is part of the contract; neither type stores a
named time zone. Confirm the target before prescribing `datetimeoffset`:
Microsoft Fabric Warehouse does not support that column type for persisted
table storage [7]. See the [`datetime`][3], [`datetime2`][4], and
[`datetimeoffset`][5] documentation.

## Performance

- **Two-tier cache coherence** — a hybrid in-process-over-distributed cache treats tag invalidation as logical (entries expire as misses, not evicted) and must not wrap its built-in stampede protection in a redundant lock.
Expand All @@ -38,3 +69,11 @@ Stack-specific review bars for .NET that the agnostic review criteria leave to a
- **Test-project placement** — integration tests as a child of a web-SDK project compile test files into the app; place them in a dedicated test project. Unit tests co-locate by responsibility; cross-cutting tests centralize.
- **Real instances for managed dependencies** — an in-memory provider or a mocked database for an application-owned store hides integration bugs; use a real instance (a container) for managed dependencies, and substitute only unmanaged, externally-visible ones.
- **Foundational library changes** — shared platform code requires thorough coverage; a bug there cascades. Critical when independently testable behavior is added without tests.

[1]: https://learn.microsoft.com/en-us/dotnet/standard/datetime/choosing-between-datetime
[2]: https://learn.microsoft.com/en-us/dotnet/standard/datetime/timeprovider-overview
[3]: https://learn.microsoft.com/en-us/sql/t-sql/data-types/datetime-transact-sql
[4]: https://learn.microsoft.com/en-us/sql/t-sql/data-types/datetime2-transact-sql
[5]: https://learn.microsoft.com/en-us/sql/t-sql/data-types/datetimeoffset-transact-sql
[6]: https://learn.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid
[7]: https://learn.microsoft.com/en-us/fabric/data-warehouse/data-types#unsupported-data-types-for-tables
38 changes: 38 additions & 0 deletions conventions/review/overlays/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,38 @@ golangci-lint analyzer set cannot fully decide. Severity labels are defined in
semantics; a value receiver must represent an intentionally copyable value.
The Go team's [review guidance][5] supplies the decision factors.

## Date and time

The shared [date-time criteria](../date-time.md) own the semantic and storage
contract. This overlay owns the Go representation.

- **Use `time.Time` and `time.Duration` by contract** — use `time.Time` for a
resolved timestamp and `time.Duration` for a fixed elapsed interval. A
floating date-only value uses an explicit domain type with no zone attachment;
a future local schedule uses explicit local fields plus its IANA zone ID.
Do not disguise either as a UTC instant. Normalize resolved instants to UTC at
the persistence boundary, and compare them with `Time.Equal`, not `==`; `==`
also compares location and monotonic-clock state. See the [`time` package][8].
- **Parse in an explicit location** — `time.Parse` interprets input without zone
information as UTC; use `time.ParseInLocation` when the contract supplies a
named location. Do not rely on `time.Local` or an abbreviation. Resolve an
ambiguous or nonexistent local time before `time.Date`: its documented choice
around an offset transition is not guaranteed. See [`ParseInLocation`][9] and
[`time.Date`][10].
- **Make zone data a deployment dependency** — `time.LoadLocation` searches the
configured path, the operating system, the Go installation, then embedded
data. A final artifact that cannot rely on those sources imports
`time/tzdata` or builds with `-tags timetzdata` (available since Go 1.15), and
is rebuilt when that data changes. Test a required named zone in the final
artifact; embedding adds binary size and belongs to the main program, not a
library. See [`time.LoadLocation`][11] and [`time/tzdata`][12].
- **Keep monotonic measurements in process** — values from `time.Now` carry a
monotonic reading, so use `Sub`, `Since`, or `Until` while both endpoints
retain it. Serialization and parsing strip that reading and fall back to wall
time; sleep behavior also varies by system, so persisted or suspend-inclusive
deadlines need a different, explicit contract. See the package's [monotonic
clock guidance][13].

## Resources and tests

- **Cleanup on every path** — close bodies, files, timers, tickers, and other
Expand Down Expand Up @@ -65,3 +97,9 @@ golangci-lint analyzer set cannot fully decide. Severity labels are defined in
[5]: https://go.dev/wiki/CodeReviewComments#receiver-type
[6]: https://go.dev/doc/articles/race_detector
[7]: https://go.dev/doc/security/fuzz/
[8]: https://pkg.go.dev/time#Time
[9]: https://pkg.go.dev/time#ParseInLocation
[10]: https://pkg.go.dev/time#Date
[11]: https://pkg.go.dev/time#LoadLocation
[12]: https://pkg.go.dev/time/tzdata
[13]: https://pkg.go.dev/time#hdr-Monotonic_Clocks
28 changes: 28 additions & 0 deletions conventions/review/overlays/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,34 @@ Stack-specific review bars for Python. The mechanically enforced posture is owne
- **Immutability by default** — internal value objects and API models are frozen rather than mutable bags.
- **Explicit results for domain-heavy flows** — a domain-heavy service may model success and failure explicitly (an explicit result type) rather than control-flow exceptions, mirroring the result-modeling default; infrastructure failures stay exceptions.

## Date and time

The shared [date-time criteria](../date-time.md) own the semantic and storage
contract. This overlay owns the Python representation.

- **Aware `datetime` values represent instants** — use `date` for a date-only
value, `time` for a time of day, `timedelta` for a duration, and an aware
`datetime` for an instant. Create UTC with `datetime.now(timezone.utc)` (or
`datetime.now(UTC)` on Python 3.11 and later), not `datetime.utcnow()`:
`utcnow()` returns a naive value and is deprecated in Python 3.12. Never
silently attach UTC to an unvalidated naive value. See the [`datetime`
documentation][1].
- **Use `zoneinfo` with a declared data source** — on Python 3.9 and later,
resolve IANA IDs with `ZoneInfo` and make the `fold` policy explicit for an
ambiguous local input. The module is unavailable on WASI and does not bundle
zone data; cross-platform projects that require named zones declare the
first-party `tzdata` dependency instead of assuming the host supplies it.
See the [`zoneinfo` documentation][2].
- **Measure with a monotonic clock** — use `time.monotonic()` or
`time.monotonic_ns()` for elapsed time and in-process deadlines, not
`datetime.now()` or `time.time()`. The reference point is deliberately
undefined, so only differences within the process are meaningful. See the
[`time` documentation][3].

## Testing

- **Tests for non-trivial package logic** — a package carrying real logic, a CLI boundary, or regression-prone parsing has tests for it; "covered by a consumer" is not a default. Framework and placement remain repository-specific.

[1]: https://docs.python.org/3/library/datetime.html
[2]: https://docs.python.org/3/library/zoneinfo.html
[3]: https://docs.python.org/3/library/time.html#time.monotonic
33 changes: 33 additions & 0 deletions conventions/review/overlays/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,39 @@ Stack-specific review bars for TypeScript and JavaScript. The mechanically enfor
- **Validate at the boundary** — external input (tool parameters, API responses, configuration) is parsed and validated with a runtime schema at the entry point, not trusted from a type annotation alone.
- **No stray stdout in a transport server** — a server using standard streams as its transport must not write logs to stdout; diagnostics go to stderr. (Biome's no-console rule enforces this where configured.)

## Date and time

The shared [date-time criteria](../date-time.md) own the semantic and storage
contract. This overlay owns the JavaScript runtime representation.

- **Gate `Temporal` on the supported runtimes** — use `Temporal.Instant`,
`Temporal.ZonedDateTime`, and the appropriate `Temporal.Plain*` type when
their semantics match the contract. `Temporal` is a [Stage 4
specification][6], but do not assume the global exists: MDN marks it as
[limited availability and not Baseline][1]. When a target lacks it, add and
import a project-reviewed polyfill explicitly. The proposal champions'
[`@js-temporal/polyfill` README][2] says that package is not affiliated with
TC39, does not install a global `Temporal`, supports Node.js 14 and later, and
ships ES2020; test the target's runtime and bundle compatibility. Do not use
legacy `Date` for named-zone or civil-time arithmetic.
- **Parse a declared wire format** — `Date` stores only an epoch-millisecond
instant, not a time zone. Validate a standards-conforming string with an
explicit offset before constructing it; reject non-standard or offset-less
date-time input unless the boundary explicitly defines civil-time semantics.
The [`Date` documentation][3] records the implementation-defined fallback
formats and the historic UTC-versus-local parsing inconsistency.
- **Use a monotonic elapsed-time source** — use [`performance.now()`][4] in a
browser and [`process.hrtime.bigint()`][5] in Node.js instead of subtracting
`Date.now()` values. Browser behavior while the operating system sleeps still
varies, so a suspend-inclusive deadline needs target-specific evidence.

## Testing

- **Tests for package logic** — a logic change in a package has a co-located test or an updated package test. A protocol or transport boundary (parameter validation, lifecycle, framing) gets integration coverage when its behavior changes. Framework and placement remain repository-specific.

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal
[2]: https://github.com/js-temporal/temporal-polyfill
[3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date
[4]: https://developer.mozilla.org/en-US/docs/Web/API/Performance/now
[5]: https://nodejs.org/api/process.html#processhrtimebigint
[6]: https://tc39.es/proposal-temporal/