diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 72a0c43..0000000 --- a/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -# Preserve upstream license/notice formatting, including original whitespace. -notices/*.txt -whitespace -notices/RUST_LIBRARY_NOTICES.html -whitespace -tools/notices/supplements/*.txt -whitespace diff --git a/.github/actions/ci-tools/action.yml b/.github/actions/ci-tools/action.yml index 1664053..1d4a5bf 100644 --- a/.github/actions/ci-tools/action.yml +++ b/.github/actions/ci-tools/action.yml @@ -2,7 +2,7 @@ name: Prepare pinned CI tools description: Restore or install verified tool binaries independently of application builds inputs: group: - description: worker, browser, or notices + description: worker or browser required: true runs: using: composite diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 778a8e7..5eff222 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -17,7 +17,6 @@ jobs: tooling: ${{ steps.select.outputs.tooling }} worker: ${{ steps.select.outputs.worker }} configurable-chart: ${{ steps.select.outputs.configurable-chart }} - notices: ${{ steps.select.outputs.notices }} steps: - uses: actions/checkout@v4 with: @@ -26,6 +25,9 @@ jobs: with: bun-version: '1.3.14' - run: bun test tools/ci + - run: bun install --frozen-lockfile + working-directory: examples/configurable-chart + - run: bun examples/configurable-chart/node_modules/typescript/bin/tsc --project tools/ci/tsconfig.json - id: select run: bun tools/ci/changes.ts usage-policy: @@ -37,36 +39,6 @@ jobs: python-version: '3.13' - run: python3 tools/verification/check_prohibited_usage.py --tree HEAD - run: python3 tools/verification/test_prohibited_usage.py - notices: - needs: changes - if: needs.changes.outputs.notices == 'true' - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - uses: oven-sh/setup-bun@v2 - with: - bun-version: '1.3.14' - - run: rustup toolchain install 1.96.0 --profile minimal - - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2 - with: - cache-bin: false - workspaces: . -> target - - uses: ./.github/actions/ci-tools - with: - group: notices - - uses: ./.github/actions/bun-cache - - run: bun install --frozen-lockfile - working-directory: examples/configurable-chart - - run: bun examples/configurable-chart/node_modules/typescript/bin/tsc --project tools/notices/tsconfig.json - - run: bun examples/configurable-chart/node_modules/typescript/bin/tsc --project tools/ci/tsconfig.json - - run: cargo fetch --locked - - run: cargo fetch --locked --manifest-path examples/cloudflare-worker/Cargo.toml - - run: cargo fetch --locked --manifest-path examples/configurable-chart/wasm/Cargo.toml - - run: bun tools/notices/notices.ts verify - - run: bun test tools/notices/notices.test.ts - - run: bun tools/notices/notices.ts package-builder - - run: test -s target/distribution/dataset-builder/ASTROLOGY_ENGINE_SOURCE.tar.gz && test -s target/distribution/dataset-builder/THIRD_PARTY_NOTICES.html && test -s target/distribution/dataset-builder/RUST_LIBRARY_NOTICES.html - - run: cargo package --locked --allow-dirty --list | python3 -c 'import sys; files=set(sys.stdin.read().splitlines()); assert {"LICENSE", "NOTICE", "THIRD_PARTY_NOTICES.md", "notices/runtime.txt", "notices/RUST_LIBRARY_NOTICES.html"} <= files' configurable-chart: needs: changes if: needs.changes.outputs.configurable-chart == 'true' @@ -91,7 +63,6 @@ jobs: working-directory: examples/configurable-chart - run: bun run build && bun run check working-directory: examples/configurable-chart - - run: test -s examples/configurable-chart/build/ASTROLOGY_ENGINE_SOURCE.tar.gz && test -s examples/configurable-chart/build/THIRD_PARTY_NOTICES.html && test -s examples/configurable-chart/engine/THIRD_PARTY_NOTICES.txt && test -s examples/configurable-chart/build/RUST_LIBRARY_NOTICES.html native: needs: changes if: needs.changes.outputs.native == 'true' @@ -155,11 +126,10 @@ jobs: working-directory: examples/cloudflare-worker - run: bun run build:verification working-directory: examples/cloudflare-worker - - run: test -s examples/cloudflare-worker/build/worker/ASTROLOGY_ENGINE_SOURCE.tar.gz && test -s examples/cloudflare-worker/build/worker/THIRD_PARTY_NOTICES.txt && test -s examples/cloudflare-worker/build/RUST_LIBRARY_NOTICES.html - run: node examples/cloudflare-worker/verify.mjs verify: if: always() - needs: [changes, usage-policy, native, tooling, notices, configurable-chart, worker] + needs: [changes, usage-policy, native, tooling, configurable-chart, worker] runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index ff1971a..24290c0 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,6 @@ /.worktrees/ .DS_Store + +# Legacy local distribution output +/notices/ diff --git a/Cargo.toml b/Cargo.toml index 37a5ec2..bd7667d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ rust-version = "1.96" license = "MIT" publish = false description = "Immutable Chebyshev ephemeris evaluation and chart calculations" -include = ["/src/**", "/Cargo.toml", "/Cargo.lock", "/LICENSE", "/NOTICE", "/THIRD_PARTY_NOTICES.md", "/notices/**", "/README.md", "/data/manifest.json"] +include = ["/src/**", "/Cargo.toml", "/Cargo.lock", "/LICENSE", "/THIRD_PARTY_NOTICES.md", "/README.md", "/data/manifest.json"] [workspace] members = [".", "tools/dataset-builder"] diff --git a/NOTICE b/NOTICE deleted file mode 100644 index a22dc47..0000000 --- a/NOTICE +++ /dev/null @@ -1,6 +0,0 @@ -Astrology Engine -Copyright (c) Jack Asher - -Original project source, tools, and example adapters are licensed under the -MIT License; see LICENSE. Third-party code and data retain their existing -terms; see THIRD_PARTY_NOTICES.md. diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 2749037..f62be22 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -1,87 +1,21 @@ -# Third-party notices +# Third-party attribution -Astrology Engine's own source and local example adapters are MIT licensed; see -[LICENSE](LICENSE). Dependencies and copied code retain their respective licenses. -The project license does not relicense those components. +The Astronomy Engine code adapted in `src/astro/time.rs`, `src/astro/frames.rs` +and `tools/dataset-builder/src/astro/apparent.rs` retains the MIT license below. +Other project source uses the root MIT LICENSE. -Built artifacts include `ASTROLOGY_ENGINE_SOURCE.tar.gz`, a snapshot of the -first-party source used by the build, and `NOTICE` with the project copyright. -The HTML notices page links to that archive. Preserve these files when -redistributing; publish the archive alongside browser Wasm. If modifying the -engine, rebuild both the artifact and source snapshot. External dependency -source remains available through the pinned links below. - -## Copied and adapted code - -Astronomy Engine's MIT attribution applies to `src/astro/time.rs`, -`src/astro/frames.rs`, and the corresponding native apparent-position transforms. -Its original copyright and complete permission notice appear below and in every -distribution bundle. - -## Dependency distributions - -The checked-in bundles include license texts, copyright notices, source URLs, -and required upstream notices for the locked dependency graphs: - -- [Runtime](notices/runtime.txt): native/Rust consumers of Astrology Engine. -- [Native builder](notices/builder.txt): dataset preparation with ANISE. -- [Worker](notices/worker.txt): the Cloudflare example and its emitted JavaScript. -- [Browser](notices/browser.txt): the configurable-chart Wasm example and JavaScript helpers. - -These inventories conservatively include Rust build dependencies; a listing does -not claim that every package's code is present in a particular binary. Browser -and Worker bundles also preserve notices for code emitted by their generators. - -`hifitime` 4.3.0 is an MPL-2.0 runtime dependency. `anise` 0.10.1 is an MPL-2.0 -native-builder dependency; it is not part of the default runtime. Their source -is unmodified in this project. Their exact published source distributions are: +Dependencies are downloaded separately and retain their own licenses. Before +redistributing compiled binaries, browser Wasm, generated JavaScript or bundled +dependencies, include the licenses/attributions required by the components +actually shipped. Local builds do not assemble a distribution license bundle. +MPL-covered hifitime 4.3.0 and native-builder dependency ANISE 0.10.1 additionally +require informing recipients where to obtain corresponding MPL source: - https://static.crates.io/crates/hifitime/hifitime-4.3.0.crate - https://static.crates.io/crates/anise/anise-0.10.1.crate -When distributing executables or browser Wasm containing MPL code, preserve the -notices and tell recipients where to obtain its corresponding source under MPL. -Keep that source accessible while distributing the artifact; if upstream access -fails, provide an accessible copy. If you modify covered dependency source, -provide the actual modified source under MPL rather than linking only to the -unmodified upstream package. These requirements concern the covered files; they -do not change the license of separately written project files. See the -[MPL text](https://www.mozilla.org/en-US/MPL/2.0/) and -[distribution FAQ](https://www.mozilla.org/en-US/MPL/2.0/FAQ/). - -The native builder uses the unchanged `sofars` Rust port through ANISE. It uses -routines and computations derived from software provided by the IAU SOFA Board -under license. This project and that port are not software provided by or -endorsed by SOFA. We do not modify the port's routines. The builder bundle -preserves both the port's MIT notice and its additional SOFA terms. Similarly, -`libm`'s complete license and per-routine math-library notices are retained. - -The [Rust standard-library notices](notices/RUST_LIBRARY_NOTICES.html) from -Rust 1.96.0 accompany each compiled distribution. This covers the standard-library -components conservatively across targets, not redistribution of the whole Rust -compiler or toolchain. - -## Development and test tools - -Python acquisition and verification dependencies are pinned separately in -`tools/jpl/requirements.lock`; they are not bundled into runtime Wasm or native -Rust executables. In particular, `certifi` 2026.5.20 includes MPL-2.0 certificate -material. Its exact source distribution is available through -https://pypi.org/project/certifi/2026.5.20/#files . Preserve its license/source -notices if distributing that Python environment. - -Bun, Cargo, Rust, cargo-about, TypeScript, Wrangler, Miniflare, and other build or -test tools keep their upstream licenses. Installing a development tool is not -itself redistribution of its entire implementation. Notices for emitted code -from wasm-bindgen, worker-build, and Vite are included where applicable. The -bundles do not cover redistribution of complete SDKs or development environments. - -## Data - -JPL inputs and the recorded regression fixtures are separate from dependency -software licensing. Preserve their existing source records, hashes and dataset -manifests. The software license does not purport to relicense third-party -datasets. No dataset is regenerated by notice preparation. +Modified covered dependencies require their actual corresponding modified source. +Dataset provenance and source records are separate and remain with the data. ## Astronomy Engine — MIT License diff --git a/docs/worker-runbook.md b/docs/worker-runbook.md index 9b11c14..e2f3426 100644 --- a/docs/worker-runbook.md +++ b/docs/worker-runbook.md @@ -544,12 +544,8 @@ You may remove `.wrangler/demo-state` and `.wrangler/demo-evidence` locally when finished. Keep the generated dataset, JPL cache, and provenance if you want to reuse them. Removing this demo does not cancel an account's R2 subscription. -## Distribution notices - -Use `bun run build` or `bun run build:verification` rather than invoking -`worker-build` directly when preparing distributable artifacts. Both wrappers -include the project license and applicable notices in `build/` and -`build/worker/`; the Wrangler build command uses the ordinary wrapper too. Keep -these files with any shared artifact directory. The notices include exact MPL -source links. See the [notice guide](../tools/notices/README.md) before updating -dependencies or distributing modified dependency source. +## Distribution + +Builds produce local development artifacts. Before redistributing compiled +artifacts, include applicable dependency licenses and source-access notices; +see [third-party attribution](../THIRD_PARTY_NOTICES.md). diff --git a/examples/cloudflare-worker/build.ts b/examples/cloudflare-worker/build.ts index bdca3ec..6d998e4 100644 --- a/examples/cloudflare-worker/build.ts +++ b/examples/cloudflare-worker/build.ts @@ -2,17 +2,13 @@ // SPDX-License-Identifier: MIT import { execFileSync } from 'node:child_process'; -import { dirname, resolve } from 'node:path'; +import { dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; -import { check, copy, workerBuildVersion } from '../../tools/notices/core.ts'; +import { workerBuildVersion } from '../../tools/ci/versions.ts'; const directory = dirname(fileURLToPath(import.meta.url)); -const root = resolve(directory, '../..'); const flags = process.argv.slice(2); if (flags.length > 1 || flags.some(flag => flag !== '--verification')) throw new Error('Usage: bun build.ts [--verification]'); -check(root); const version = execFileSync('worker-build', ['--version'], { encoding: 'utf8' }).trim().split(/\s+/).at(-1); if (version !== workerBuildVersion) throw new Error(`Expected worker-build ${workerBuildVersion}, got ${version}`); execFileSync('worker-build', ['--release', ...(flags.length ? ['--', '--features', 'verification'] : [])], { cwd: directory, stdio: 'inherit' }); -copy(root, 'worker', resolve(directory, 'build')); -copy(root, 'worker', resolve(directory, 'build/worker')); diff --git a/examples/configurable-chart/README.md b/examples/configurable-chart/README.md index 6ac8e83..b35781d 100644 --- a/examples/configurable-chart/README.md +++ b/examples/configurable-chart/README.md @@ -75,15 +75,11 @@ Git revision. Frozen captures include the dataset endpoints, polar house cases, and all supported Tropical/True Sky division and Ophiuchus settings. Fagan–Bradley serialization and all house methods also receive Wasm smoke checks. -## Distribution notices - -Wasm preparation and the static build include `LICENSE`, -`THIRD_PARTY_NOTICES.txt`, `THIRD_PARTY_NOTICES.html`, and -`RUST_LIBRARY_NOTICES.html`. Preserve those files -when publishing the output. The page's Third-party notices link provides the -license texts and exact-version MPL source links to recipients. Builds fail if -the checked-in notices are stale; refresh them using the -[notice guide](../../tools/notices/README.md). +## Distribution + +Builds produce local development artifacts. Before redistributing them, include +the applicable dependency licenses and source-access notices described in +[third-party attribution](../../THIRD_PARTY_NOTICES.md). ## Optional two-year browser downloads diff --git a/examples/configurable-chart/build-wasm.ts b/examples/configurable-chart/build-wasm.ts index a24d231..0e1bf1f 100644 --- a/examples/configurable-chart/build-wasm.ts +++ b/examples/configurable-chart/build-wasm.ts @@ -1,11 +1,8 @@ // Copyright (c) Jack Asher // SPDX-License-Identifier: MIT -import { check, copy, wasmBindgenVersion } from '../../tools/notices/core.ts'; -import { resolve } from 'node:path'; +import { wasmBindgenVersion } from '../../tools/ci/versions.ts'; -const root = resolve(import.meta.dir, '../..'); -check(root); const run = (cmd: string[]) => { const result = Bun.spawnSync(cmd, {stdout: 'inherit', stderr: 'inherit'}); if (result.exitCode !== 0) throw new Error(`Command failed: ${cmd.join(' ')}`); @@ -15,6 +12,3 @@ const version = Bun.spawnSync([bindgen, '--version']); if (version.exitCode !== 0 || version.stdout.toString().trim() !== `wasm-bindgen ${wasmBindgenVersion}`) throw new Error(`Expected wasm-bindgen ${wasmBindgenVersion}`); run(['cargo', 'build', '--locked', '--release', '--target', 'wasm32-unknown-unknown', '--manifest-path', 'wasm/Cargo.toml']); run([bindgen, 'wasm/target/wasm32-unknown-unknown/release/configurable_chart_example.wasm', '--target', 'web', '--out-dir', 'engine', '--out-name', 'chart']); - -copy(root, 'browser', resolve('engine')); -copy(root, 'browser', resolve('public')); diff --git a/examples/configurable-chart/index.html b/examples/configurable-chart/index.html index fa4a58f..9608126 100644 --- a/examples/configurable-chart/index.html +++ b/examples/configurable-chart/index.html @@ -13,5 +13,4 @@
Your chart will appear here.-