Skip to content
Open
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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ name: AR2 CI
on: [push, pull_request]

jobs:
license:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: License posture (canonical EUPL-1.2 + SPDX headers)
run: bash scripts/license_check.sh

lint:
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 14 additions & 0 deletions .stomata/lessons.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@
{"date": "2026-08-14", "what": "The same document predicted that a check which becomes noise 'gets waived, then gets deleted'. Two checks became noise and were ignored for days by the author who wrote that sentence.", "where": "workplan/2026-08/rajat_ar2_closeout_20260814.md:418"}
]
},
{
"recurrence_key": "license-posture-unchecked",
"trigger": "You are adding, editing or citing a LICENSE file, a license declaration in prose, or a per-file license header.",
"directive": "Pin the license file to the canonical text by hash and check every source file for its header in CI. A license is a control that binds outsiders, and it fails silently: a truncated file or a prose-only declaration looks licensed to everyone who does not read it end to end.",
"kind": "mechanized",
"enforced_by": [
"scripts/license_check.sh",
".github/workflows/ci.yml"
],
"occurrences": [
{"date": "2026-08-26", "what": "LICENSE in ar2 and ar2-hub was the first 134 lines of MPL-2.0, cut mid-sentence in section 2.4 -- the copyleft core and exhibits were absent, and GitHub reported NOASSERTION. Nothing had ever checked it.", "where": "workplan/2026-08/core_license_posture_20260826.md"},
{"date": "2026-08-26", "what": "pancake had no LICENSE file at all while GOVERNANCE.md line 5 declared Apache 2.0 in prose, a permissive license contradicting the copyleft intent.", "where": "workplan/2026-08/core_license_posture_20260826.md"}
]
},
{
"recurrence_key": "run-record-not-at-the-reviewed-commit",
"trigger": "You are reading a run record, CI result or packet to decide whether a branch is sound.",
Expand Down
371 changes: 261 additions & 110 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions app/auth.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/database.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/geoid_v2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""GeoID v2: content-derived field identity, and area-exact comparison of covers.

The regime, per doc/current/dpi_architecture_20260812.md S10:
Expand Down
4 changes: 4 additions & 0 deletions app/grant_verifier.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/meal_logger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

import os

import httpx
Expand Down
4 changes: 4 additions & 0 deletions app/merkle.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

from __future__ import annotations

import hashlib
Expand Down
4 changes: 4 additions & 0 deletions app/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/models/geo_id_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/routers/analytics_and_maintenance_apis.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/routers/fetch_field.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/routers/field_registration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/routers/point_registration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/routers/traceforward.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

import hashlib
import os

Expand Down
4 changes: 4 additions & 0 deletions app/s2_services.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/schemas.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
4 changes: 4 additions & 0 deletions app/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

import base64
import json
import time
Expand Down
4 changes: 4 additions & 0 deletions app/tests/test_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

import os

import pytest
Expand Down
4 changes: 4 additions & 0 deletions app/tests/test_fsma204_traceability.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""FSMA 204 end-to-end traceability scenario: romaine lettuce, field to retail.

This file does two jobs. It is a regression harness for the trace-back and
Expand Down
4 changes: 4 additions & 0 deletions app/tests/test_geoid_v2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

import json
import os

Expand Down
4 changes: 4 additions & 0 deletions app/tests/test_geoid_v2_iou.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

from shapely.wkt import loads

from app.utils import Utils
Expand Down
4 changes: 4 additions & 0 deletions app/tests/test_geoid_v2_live.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""GeoID v2 in the live registration path, and the exact cover comparison.

Three changes are pinned here.
Expand Down
4 changes: 4 additions & 0 deletions app/tests/test_geoid_v2_properties.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

from app.utils import Utils


Expand Down
4 changes: 4 additions & 0 deletions app/tests/test_traceforward.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

import json
import os
import uuid
Expand Down
4 changes: 4 additions & 0 deletions app/tests/testkit/mint_test_authority_credentials.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""Mint test Authority credentials (vct: agstack.org/credentials/traceforward-authority/v1).

Usage:
Expand Down
4 changes: 4 additions & 0 deletions app/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
Expand Down
3 changes: 3 additions & 0 deletions migration/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.
4 changes: 4 additions & 0 deletions migration/db_repo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
SQLAlchemy-backed TargetRepo.

Expand Down
4 changes: 4 additions & 0 deletions migration/geoid_v2.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
GeoID v2 — content-derived field identity.

Expand Down
4 changes: 4 additions & 0 deletions migration/models.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
SQLAlchemy models for the import's target tables.

Expand Down
4 changes: 4 additions & 0 deletions migration/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
The import: AR 1.0 polygons -> AR2, TerraPipe profiles -> Hub + Pancake.

Expand Down
4 changes: 4 additions & 0 deletions migration/repo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
Target-side repository: AR2 registry, Hub accounts, Pancake profiles.

Expand Down
4 changes: 4 additions & 0 deletions migration/resolve.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
Area-exact IoU and containment over S2 token covers.

Expand Down
4 changes: 4 additions & 0 deletions migration/run.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
Import rehearsal runner.

Expand Down
4 changes: 4 additions & 0 deletions migration/sample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
Adversarial stratified sampling (M2).

Expand Down
4 changes: 4 additions & 0 deletions migration/sources.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
Legacy source adapters — AR 1.0 (polygons) and TerraPipe (profiles).

Expand Down
3 changes: 3 additions & 0 deletions migration/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.
4 changes: 4 additions & 0 deletions migration/tests/test_db_repo.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
Tests for the SQLAlchemy repository against real databases (SQLite here,
Postgres in the rehearsal).
Expand Down
4 changes: 4 additions & 0 deletions migration/tests/test_limit_invalidates_joins.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""--limit truncates fields only, so every join figure it produces is an artifact.

`run.py` passes `--limit` to `import_fields` but not to `import_profiles`. Every
Expand Down
4 changes: 4 additions & 0 deletions migration/tests/test_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""End-to-end import rehearsal on synthetic AR1 + TerraPipe fixtures.

Run: python -m pytest migration/tests/test_pipeline.py -v
Expand Down
4 changes: 4 additions & 0 deletions migration/tests/test_points_are_importable.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""Pins must import, not quarantine.

The first full run against the live AR 1.0 registry quarantined 14,594 of 28,282
Expand Down
4 changes: 4 additions & 0 deletions migration/tests/test_primitive.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""Verification of the v2 primitive and the resolution arithmetic.

Run: python -m pytest migration/tests/test_primitive.py -v
Expand Down
4 changes: 4 additions & 0 deletions migration/tests/test_report_arithmetic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""The report's categories must add up, and must not overlap.

THE INCIDENT. On 2026-08-19 an import run reported 268 fields quarantined and 268
Expand Down
4 changes: 4 additions & 0 deletions migration/tests/test_sample.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
Tests for adversarial sampling (M2).

Expand Down
4 changes: 4 additions & 0 deletions migration/tests/test_schema_drift.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: EUPL-1.2
# Copyright (c) 2026 AgStack project contributors.
# Licensed under the EUPL, Version 1.2; see the LICENSE file for the full text.

"""
Drift guard: models.py mirrors the shipped schemas rather than importing them,
so something has to notice when the real ones change.
Expand Down
Loading
Loading