From 4306b54c9f01f7c98d78b7fd2d4f082d1ade7a63 Mon Sep 17 00:00:00 2001 From: 5027 <326748487@qq.com> Date: Fri, 11 Sep 2026 13:41:16 +0800 Subject: [PATCH] =?UTF-8?q?chore(repo):=20Remove=20unused=20files=20/=20?= =?UTF-8?q?=E6=B8=85=E7=90=86=E6=97=A0=E7=94=A8=E6=96=87=E4=BB=B6=E4=B8=8E?= =?UTF-8?q?=E8=BF=87=E6=97=B6=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit English: - Remove 24 redundant or unused files: duplicate READMEs, the one-off handoff prompt, an obsolete change note, debug HTML, five empty packages, the disconnected planner and its tests, ten unused SVGs, and a generated region report. - Update references, actual architecture, deployment credential semantics, completed handoff status and report ignore rules. Keep historical release and promotion material clearly marked instead of treating it as current instructions. - Add a maintenance audit with seven unresolved issues and five verified missing region files. Active runtime logic, real geometry, compatibility tables and UI regressions remain; no production deployment or region download was performed. 中文: - 删除 24 个重复或无用文件,包括重复 README、一次性交接提示、旧变更说明、调试页面、五个空包、未接入的 planner 及测试、十个无引用 SVG 和生成报告。 - 修正引用、实际架构、部署账号语义、已完成交接状态及报告忽略规则;历史发布和推广材料明确标为旧资料。 - 新增维护清单,列出七项未解决问题及五个已核实缺失区域;保留有效运行逻辑、真实几何、兼容表和页面回归,没有生产部署或区域下载。 Validation: - From apps/admin-region-tiler: node scripts/release_preflight.mjs passed, including go test ./..., JavaScript syntax, rendering security, real API lifecycle tests, 390/768/1440px browser regressions, preview renewal, session re-login, sensitive-value and generated-file scans / 完整发布预检通过。 - From apps/admin-region-tiler: go vet ./... passed / 通过。 - Inline Node assertions passed: 35 local documentation links, 24 direct static references, 11 dynamic icons, six unused package dependencies absent, both report paths ignored / 链接、资源、导入和忽略规则校验通过。 - Region catalog metadata audit: 3227 entries and exactly five missing files; no geometry writes / 区域目录核对确认五项缺口,未修改几何。 - python C:/Users/32674/.codex/skills/deep-execution-upgrade/scripts/audit_environment.py --mode workspace --workspace . --format text: no high-signal drift / 无明显漂移。 - python C:/Users/32674/.codex/skills/deep-execution-upgrade/scripts/validate_handoff_contract.py --path docs/long-term-memory.md --format text: valid / 通过。 - git diff --check and changed-document sensitive-value review passed / 差异及新增文档敏感值检查通过。 - Local race checks not run because Windows lacks the required C compiler; Linux CI runs go test -race ./... before merge / 本地 race 受编译器限制,合并前由 Linux CI 验证。 - Python region maintenance tools were reviewed but not executed against providers or deployment directories / 区域维护工具仅审查,未调用真实服务或覆盖部署目录。 --- .gitignore | 2 + README_ZH.md | 110 ---------- RELEASE_HANDOFF_PROMPT.md | 44 ---- apps/admin-region-tiler/.dockerignore | 2 + apps/admin-region-tiler/CHANGES.md | 6 - apps/admin-region-tiler/README-EN.md | 79 -------- apps/admin-region-tiler/README.md | 22 +- apps/admin-region-tiler/deploy/DEPLOYMENT.md | 32 ++- .../geojson/materialize-report.json | 30 --- apps/admin-region-tiler/internal/api/doc.go | 3 - .../internal/artifact/doc.go | 3 - apps/admin-region-tiler/internal/auth/doc.go | 2 - .../admin-region-tiler/internal/config/doc.go | 3 - .../internal/downloader/doc.go | 4 +- .../internal/planner/doc.go | 4 - .../internal/planner/model.go | 191 ------------------ .../internal/planner/model_test.go | 89 -------- apps/admin-region-tiler/internal/web/doc.go | 2 - .../static/assets/icons/calendar.svg | 5 - .../static/assets/icons/clock.svg | 5 - .../static/assets/icons/error.svg | 5 - .../static/assets/icons/filter.svg | 5 - .../static/assets/icons/folder.svg | 5 - .../static/assets/icons/pause.svg | 5 - .../static/assets/icons/play.svg | 5 - .../static/assets/icons/search.svg | 5 - .../static/assets/logo/logo.svg | 7 - apps/admin-region-tiler/static/favicon.svg | 6 - apps/admin-region-tiler/static/test.html | 38 ---- docs/ai-operating-handbook.md | 16 +- docs/automation-guardrails.md | 4 +- docs/github-growth-playbook.md | 4 + docs/long-term-memory.md | 19 +- docs/maintenance-audit-2026-09-11.md | 70 +++++++ docs/merge-plan.md | 16 +- docs/project-map.md | 14 +- docs/releases/v0.1.0.md | 4 + 37 files changed, 159 insertions(+), 707 deletions(-) delete mode 100644 README_ZH.md delete mode 100644 RELEASE_HANDOFF_PROMPT.md delete mode 100644 apps/admin-region-tiler/CHANGES.md delete mode 100644 apps/admin-region-tiler/README-EN.md delete mode 100644 apps/admin-region-tiler/geojson/materialize-report.json delete mode 100644 apps/admin-region-tiler/internal/api/doc.go delete mode 100644 apps/admin-region-tiler/internal/artifact/doc.go delete mode 100644 apps/admin-region-tiler/internal/auth/doc.go delete mode 100644 apps/admin-region-tiler/internal/config/doc.go delete mode 100644 apps/admin-region-tiler/internal/planner/doc.go delete mode 100644 apps/admin-region-tiler/internal/planner/model.go delete mode 100644 apps/admin-region-tiler/internal/planner/model_test.go delete mode 100644 apps/admin-region-tiler/internal/web/doc.go delete mode 100644 apps/admin-region-tiler/static/assets/icons/calendar.svg delete mode 100644 apps/admin-region-tiler/static/assets/icons/clock.svg delete mode 100644 apps/admin-region-tiler/static/assets/icons/error.svg delete mode 100644 apps/admin-region-tiler/static/assets/icons/filter.svg delete mode 100644 apps/admin-region-tiler/static/assets/icons/folder.svg delete mode 100644 apps/admin-region-tiler/static/assets/icons/pause.svg delete mode 100644 apps/admin-region-tiler/static/assets/icons/play.svg delete mode 100644 apps/admin-region-tiler/static/assets/icons/search.svg delete mode 100644 apps/admin-region-tiler/static/assets/logo/logo.svg delete mode 100644 apps/admin-region-tiler/static/favicon.svg delete mode 100644 apps/admin-region-tiler/static/test.html create mode 100644 docs/maintenance-audit-2026-09-11.md diff --git a/.gitignore b/.gitignore index 6d14ec6..2b8d997 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,8 @@ run.stderr.log .tmp-region-data/ tmp/ .playwright-mcp/ +apps/admin-region-tiler/geojson/materialize-report.json +apps/admin-region-tiler/geojson/download-report.json # OS/editor noise .DS_Store diff --git a/README_ZH.md b/README_ZH.md deleted file mode 100644 index e7f8890..0000000 --- a/README_ZH.md +++ /dev/null @@ -1,110 +0,0 @@ -# Map Tile Fetcher - -一个自托管的 Go Web 地图瓦片下载工具,支持按地图框选范围或 -GeoJSON/行政区划创建下载任务,并导出 ZIP 文件树或 MBTiles。 - -> 请只用于你有权访问和下载的地图瓦片服务。项目提供限速、重试和本地 -> token 配置能力,但不会授权绕过任何第三方服务条款、配额或访问限制。 - -![Map Tile Fetcher 主界面](docs/assets/dashboard-overview.png) - -## 适合谁 - -- 需要在内网或自己的服务器上运行地图瓦片下载工具的 GIS/地图开发者。 -- 需要按矩形 bbox、行政区划或 GeoJSON 范围批量生成离线瓦片的人。 -- 需要把授权地图源导出为 ZIP 文件树或 MBTiles 的项目维护者。 -- 想要一个 Go + SQLite + 静态 Web UI 的轻量自托管方案的团队。 - -## 核心能力 - -- **范围框选下载**:在 Leaflet 地图上框选 bbox,自动估算瓦片数量和体积。 -- **行政区划/GeoJSON 下载**:按内置区域目录或 GeoJSON 层级创建任务。 -- **多地图源配置**:支持天地图、Mapbox、OSM、Google 样例和自定义瓦片 URL。 -- **任务和产物管理**:查看进度、失败记录、重试失败瓦片,并下载 ZIP/MBTiles。 - -## 三分钟启动 - -```powershell -git clone https://github.com/Joe5027/map-tile-fetcher.git -cd map-tile-fetcher\apps\admin-region-tiler -go run . -``` - -打开 `http://127.0.0.1:8081/`。 - -开发默认账号: - -- 用户名:`admin` -- 密码:`adminmap` - -生产部署时请复制 `.env.example` 为 `.env`,并修改默认账号和密码。 - -## Docker 启动 - -```powershell -cd apps\admin-region-tiler -Copy-Item .env.example .env -docker compose up --build -``` - -默认端口是 `8081`。可以在 `.env` 中调整 `HOST_PORT`、`APP_PORT`、 -`APP_DATABASE`、`AUTH_DEFAULT_USERNAME` 和 `AUTH_DEFAULT_PASSWORD`。 - -## 使用流程 - -### 1. 范围框选下载 - -![范围框选创建任务](docs/assets/bbox-task-creation.png) - -1. 登录后选择“范围框选下载”。 -2. 输入授权服务的 token,或选择不需要 token 的自定义地图源。 -3. 在地图上框选范围,设置最小/最大 zoom。 -4. 选择 ZIP 文件树或 MBTiles,创建任务。 - -### 2. 任务和产物下载 - -![产物下载](docs/assets/artifact-download.png) - -任务完成后可以在任务列表中查看成功数、失败数、产物状态,并下载生成的 -ZIP 或 MBTiles。失败记录会持久化,便于调整并发、请求间隔或代理后重试。 - -## 配置地图源 - -示例配置在 `apps/admin-region-tiler/conf.toml`。 - -安全占位符: - -- `YOUR_TIANDITU_TOKEN` -- `YOUR_MAPBOX_TOKEN` -- `YOUR_MAPBOX_SKU` - -真实 token 只应保存在本地 `.env`、本地配置或部署平台的密钥管理中,不要提交到 Git。 - -## 发布和安装 - -- 发布说明:[`docs/releases/v0.1.0.md`](docs/releases/v0.1.0.md) -- 中文用户手册:[`docs/user-manual-zh.md`](docs/user-manual-zh.md) -- English manual: [`docs/user-manual.md`](docs/user-manual.md) - -当前仓库可通过源码或 Docker 直接运行。GitHub Release 创建后,`v0.1.0` -会提供 Windows 和 Linux 二进制资产。 - -## 开发者验证 - -```powershell -cd apps\admin-region-tiler -node .\scripts\release_preflight.mjs -``` - -发布预检会运行 Go 测试、JavaScript 检查、浏览器 UI 冒烟、敏感值扫描和 -tracked 生成物扫描。 - -## 项目历史 - -旧 .NET 范围下载器运行代码已退休。bbox 框选流程已经迁移到 -`apps/admin-region-tiler` 的 Go Web 应用中;历史说明见 -[`docs/range-migration.md`](docs/range-migration.md)。 - -## 许可证 - -Apache License 2.0。详见 [`LICENSE`](LICENSE)。 diff --git a/RELEASE_HANDOFF_PROMPT.md b/RELEASE_HANDOFF_PROMPT.md deleted file mode 100644 index 464db26..0000000 --- a/RELEASE_HANDOFF_PROMPT.md +++ /dev/null @@ -1,44 +0,0 @@ -# Release Handoff Prompt - -你正在接手一个准备 GitHub 开源的 Map Tile Fetcher 仓库。当前仓库只保留一个可运行项目: - -- `apps/admin-region-tiler` - - Go 1.25+ Web 项目 - - 功能重点:范围框选下载、行政区划 GeoJSON 下载、多地图源、多任务/子任务、计划任务、SQLite 控制数据库、失败记录、产物下载、Docker/服务部署 - -旧 .NET 范围下载器已退休: - -- 原目录:`apps/range-downloader` -- 原交接来源:`01-TianDiTuDownLoader_web` -- 迁移说明:`docs/range-migration.md` -- 不要重新把旧运行代码、旧发布包、截图、UI 设计包、tmp、templates 或运行数据混进仓库。 - -请按这个顺序接手: - -1. 先阅读 `PROJECT_MANIFEST.md`,确认当前只包含 `apps/admin-region-tiler` 一个可运行项目。 -2. 检查敏感信息: - - 运行当前交接要求的敏感值扫描。 - - 同时参考 `docs/done-definition.md` 中的通用扫描规则。 - 期望没有真实 token 或密码,只允许看到 `YOUR_TIANDITU_TOKEN`、`YOUR_MAPBOX_TOKEN` 这种占位符。 -3. 验证 Go 项目: - - `cd apps/admin-region-tiler` - - 安装/使用 Go 1.25+ - - 安装/使用 Node.js 22+ 或当前稳定版本 - - 如需运行 UI 冒烟测试,确保本地或全局可用 Playwright,并安装 Chromium: - `npm install -g playwright` 和 `npx playwright install chromium` - - 执行 `go test ./...` - - 前端脚本变更后执行 `node --check .\static\script.js` - - 发布前执行完整预检:`node .\scripts\release_preflight.mjs` -4. 不要提交运行目录或构建目录:`.env`、`data/`、`output/`、`tiles/`、`bin/`、`obj/`、`publish*/`、历史二进制和压缩包都不应进 Git。 -5. README 语言分工: - - `README.md`: English - - `README_ZH.md`: 中文 -6. 每一次验证完成的变动都需要立即提交 git,且 commit body 必须有英文、中文和 Validation 三段。 - -当前仓库已完成的合并状态: - -- Go 后端是唯一运行后端。 -- 范围框选下载已迁移到 Go app 的 `mode: "bbox"` 任务。 -- 行政区划下载保留在同一 Go app 中。 -- SQLite 保留为控制数据库,只存任务、运行、任务源、产物和失败记录等元数据。 -- 下载瓦片、MBTiles、ZIP 产物和运行日志走文件系统,不进入 Git。 diff --git a/apps/admin-region-tiler/.dockerignore b/apps/admin-region-tiler/.dockerignore index 1b374da..7f1a6c8 100644 --- a/apps/admin-region-tiler/.dockerignore +++ b/apps/admin-region-tiler/.dockerignore @@ -8,6 +8,8 @@ tiles/ dist/ build/ .tmp-region-data/ +geojson/materialize-report.json +geojson/download-report.json tiler tiler.exe diff --git a/apps/admin-region-tiler/CHANGES.md b/apps/admin-region-tiler/CHANGES.md deleted file mode 100644 index ebbb657..0000000 --- a/apps/admin-region-tiler/CHANGES.md +++ /dev/null @@ -1,6 +0,0 @@ -### 变更说明 - -#### 2022-10-01 - -- 添加 `timedelay` 限速参数 -> 最小延迟时间`timedelay`,单位`ms`,用于请求限速,最准确的控制是将`works`设置为`1`,限速是为最准确最小间隔,若`works > 1`则`timedelay`只是个调和参数 \ No newline at end of file diff --git a/apps/admin-region-tiler/README-EN.md b/apps/admin-region-tiler/README-EN.md deleted file mode 100644 index 0ab3536..0000000 --- a/apps/admin-region-tiler/README-EN.md +++ /dev/null @@ -1,79 +0,0 @@ -# Map Tile Fetcher - -Self-hosted Go Web app for downloading authorized map tiles by bounding box or -GeoJSON/admin regions. It provides a tabbed UI for task creation and task -history, plus ZIP/MBTiles artifacts, retries, and Docker deployment assets. - -> Use this tool only with map tile services that you are authorized to access -> and download. The project does not grant permission to bypass third-party -> terms, quotas, or access controls. - -## Features - -- Bounding-box task creation with a Leaflet map. -- GeoJSON/admin-region task creation. -- Configurable map sources, including Tianditu, Mapbox, OSM, Google examples, - and custom tile URLs. -- Immediate or one-time scheduled tasks. -- ZIP file-tree and MBTiles outputs. -- Task history, progress, failure records, retries, pause/resume/cancel, and - artifact downloads. - -## Run From Source - -```powershell -go run . -``` - -Open `http://127.0.0.1:8081/`. - -Development login: - -- Username: `admin` -- Password: `adminmap` - -Override the default credentials before production deployment. - -## Docker - -This directory already includes the Docker assets needed to build the image: - -- `Dockerfile` -- `docker-compose.yml` -- `.dockerignore` - -Recommended Docker Compose workflow: - -```powershell -Copy-Item .env.example .env -docker compose up --build -d -``` - -Manual image build: - -```powershell -docker build -t map-tile-fetcher:latest . -``` - -Manual run: - -```powershell -docker run --rm --name map-tile-fetcher ` - -p 8081:8081 ` - --env-file .env ` - -v "${PWD}\data:/app/data" ` - -v "${PWD}\output:/app/output" ` - -v "${PWD}\geojson:/app/geojson" ` - -v "${PWD}\conf.toml:/app/conf.toml:ro" ` - map-tile-fetcher:latest -``` - -Use `.env.example` for port, database, timezone, and default auth settings. - -## Validation - -```powershell -go test ./... -node --check .\static\script.js -node .\scripts\release_preflight.mjs -``` diff --git a/apps/admin-region-tiler/README.md b/apps/admin-region-tiler/README.md index d6ee439..e4fce2a 100644 --- a/apps/admin-region-tiler/README.md +++ b/apps/admin-region-tiler/README.md @@ -168,15 +168,17 @@ node .\scripts\release_preflight.mjs ## 当前架构 -新的内部包结构从 `internal/` 开始: - -- `internal/api`:统一 HTTP API。 -- `internal/auth`:可选登录和会话。 -- `internal/config`:应用配置、地图源和输出路径。 -- `internal/area`:bbox 和行政区划区域选择。 -- `internal/planner`:任务定义、运行记录和子任务规划。 -- `internal/downloader`:瓦片枚举、下载、重试和写入。 -- `internal/artifact`:ZIP、MBTiles 和兼容产物。 -- `internal/web`:统一静态前端辅助。 +当前内部包和主应用的职责如下: + +- `internal/area`:bbox 和行政区划参数校验。 +- `internal/downloader`:bbox 瓦片坐标及数量计算。 +- `server.go`、`main.go`、`db.go`:HTTP API、配置、登录、SQLite 事务与迁移。 +- `runtime.go`、`queue.go`:任务控制、持久排队和工作进程调度。 +- `task.go`、`enumeration.go`、`worker_process.go`:枚举、下载、重试和写入。 +- `artifact_lifecycle.go`、`integrity.go`、`reconcile.go`:产物发布、删除、累计完整度与历史核对。 +- `static/`:登录、新建计划、任务管理及地图预览页面。 + +详细入口见 [项目地图](../../docs/project-map.md),清理结果和后续问题见 +[维护清单](../../docs/maintenance-audit-2026-09-11.md)。 旧 `.NET` 范围下载器的框选交互和简单天地图流程已迁移到当前 Go 应用,旧运行代码已退役。 diff --git a/apps/admin-region-tiler/deploy/DEPLOYMENT.md b/apps/admin-region-tiler/deploy/DEPLOYMENT.md index 26c4369..6befef3 100644 --- a/apps/admin-region-tiler/deploy/DEPLOYMENT.md +++ b/apps/admin-region-tiler/deploy/DEPLOYMENT.md @@ -11,8 +11,12 @@ ## Docker 部署 +首次启动前,复制 `.env.example` 为 `.env` 并在本地编辑 +`AUTH_DEFAULT_USERNAME`、`AUTH_DEFAULT_PASSWORD`,保持登录启用。 + ```bash cp .env.example .env +# 编辑 .env 中的初始账号后再启动 docker compose up -d --build ``` @@ -36,8 +40,11 @@ useradd -r -s /usr/sbin/nologin tiler chown -R tiler:tiler /opt/tiler ``` -4. 安装 `deploy/systemd/tiler.service` -5. 执行: +4. 首次启动前,在本地 `conf.toml` 的 `[auth]` 中设置初始用户名和密码,并限制 + 配置文件读取权限。二进制不会自动读取 `.env`;当前 systemd 示例也未配置 + `EnvironmentFile`,仅复制 `.env` 不会生效。 +5. 安装 `deploy/systemd/tiler.service` +6. 执行: ```bash systemctl daemon-reload @@ -59,20 +66,26 @@ systemctl status tiler nginx -t && systemctl reload nginx ``` -## 首次登录 +## 初始账号 - 用户名:`admin` - 密码:`adminmap` -建议上线后第一时间修改默认密码。 +以上仅为开发默认值,部署时需在首次启动前替换。应用没有已实现的改密页面或接口, +修改 `AUTH_DEFAULT_PASSWORD` 不会重置数据库里已有同名用户的密码;不要通过删除 +数据库来改密,以免丢失任务记录。已有默认账号的处置需单独安排。 -`.env` 中可以覆盖: +Docker 的 `.env` 中可以覆盖以下配置;源码或二进制需使用进程环境变量或 +`conf.toml`(`HOST_PORT` 仅用于 Docker 端口映射): - `HOST_PORT` - `APP_PORT` - `APP_DATABASE` - `AUTH_DEFAULT_USERNAME` - `AUTH_DEFAULT_PASSWORD` +- `TASK_MAX_TILES` +- `TASK_MAX_ACTIVE` +- `TASK_WORKERS` ## 数据持久化目录 @@ -107,8 +120,7 @@ nginx -t && systemctl reload nginx ## 删除任务说明 - `取消` 只改变任务状态,不会删除记录 -- `删除` 会彻底删除: - - `plans` 中的任务记录 - - `task_runs` 中的运行记录 - - 该任务对应的产物文件与输出目录 -- `删除` 不会删除共享的 `geojson/` 区域文件 +- `删除` 会清理任务记录、历史运行、产物、失败记录和关联元数据;父任务包括全部子任务。 +- 运行、暂停或打包中的任务需要先取消并等待结束。清理失败后可重试。 +- 内置区域文件和仍有其他任务引用的文件受保护;任务生成的区域文件在最后一个引用解除后清理。 +- 升级前的备份、副本验证和历史核对方式见 [修复验收记录](../../../docs/repair-acceptance-2026-09-11.md)。 diff --git a/apps/admin-region-tiler/geojson/materialize-report.json b/apps/admin-region-tiler/geojson/materialize-report.json deleted file mode 100644 index f112ab1..0000000 --- a/apps/admin-region-tiler/geojson/materialize-report.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "written": 3221, - "missing": [ - { - "id": "460323", - "name": "中沙群岛的岛礁及其海域", - "level": "district" - }, - { - "id": "653228", - "name": "和康县", - "level": "district" - }, - { - "id": "653229", - "name": "和安县", - "level": "district" - }, - { - "id": "659011", - "name": "新星市", - "level": "district" - }, - { - "id": "659012", - "name": "白杨市", - "level": "district" - } - ] -} \ No newline at end of file diff --git a/apps/admin-region-tiler/internal/api/doc.go b/apps/admin-region-tiler/internal/api/doc.go deleted file mode 100644 index e7cf54a..0000000 --- a/apps/admin-region-tiler/internal/api/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package api will own the unified HTTP surface for task creation, task -// controls, configuration, artifacts, and optional authentication. -package api diff --git a/apps/admin-region-tiler/internal/artifact/doc.go b/apps/admin-region-tiler/internal/artifact/doc.go deleted file mode 100644 index 23952af..0000000 --- a/apps/admin-region-tiler/internal/artifact/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package artifact will build and index downloadable outputs such as ZIP, -// MBTiles, and compatibility archives. -package artifact diff --git a/apps/admin-region-tiler/internal/auth/doc.go b/apps/admin-region-tiler/internal/auth/doc.go deleted file mode 100644 index 40cb761..0000000 --- a/apps/admin-region-tiler/internal/auth/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package auth will contain optional local authentication and session helpers. -package auth diff --git a/apps/admin-region-tiler/internal/config/doc.go b/apps/admin-region-tiler/internal/config/doc.go deleted file mode 100644 index 64f4661..0000000 --- a/apps/admin-region-tiler/internal/config/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -// Package config will normalize application settings, map sources, token -// placeholders, output paths, and deployment defaults. -package config diff --git a/apps/admin-region-tiler/internal/downloader/doc.go b/apps/admin-region-tiler/internal/downloader/doc.go index 26cc4ad..d9739bd 100644 --- a/apps/admin-region-tiler/internal/downloader/doc.go +++ b/apps/admin-region-tiler/internal/downloader/doc.go @@ -1,3 +1,3 @@ -// Package downloader will own tile enumeration, fetching, retry, throttling, -// and file or MBTiles writes for unified task runs. +// Package downloader provides bounding-box tile math shared by validation and +// enumeration. Fetching and output writes remain in the main application. package downloader diff --git a/apps/admin-region-tiler/internal/planner/doc.go b/apps/admin-region-tiler/internal/planner/doc.go deleted file mode 100644 index 0775d7a..0000000 --- a/apps/admin-region-tiler/internal/planner/doc.go +++ /dev/null @@ -1,4 +0,0 @@ -// Package planner translates unified task requests into validated task -// definitions that can later be persisted and expanded into child source/layer -// work items. -package planner diff --git a/apps/admin-region-tiler/internal/planner/model.go b/apps/admin-region-tiler/internal/planner/model.go deleted file mode 100644 index 94138be..0000000 --- a/apps/admin-region-tiler/internal/planner/model.go +++ /dev/null @@ -1,191 +0,0 @@ -package planner - -import ( - "errors" - "strings" - "time" - - "tiler/internal/area" -) - -const ( - ScheduleImmediate ScheduleMode = "immediate" - ScheduleOnce ScheduleMode = "once" - - OutputFiles OutputFormat = "files" - OutputMBTiles OutputFormat = "mbtiles" - - PackageZIP PackageFormat = "zip" - PackageTarGZ PackageFormat = "tar.gz" -) - -type ScheduleMode string -type OutputFormat string -type PackageFormat string - -type Request struct { - Name string `json:"name"` - Mode area.Mode `json:"mode"` - Area area.Spec `json:"area"` - Sources []Source `json:"sources"` - Zoom area.ZoomRange `json:"zoom"` - Schedule Schedule `json:"schedule"` - Output Output `json:"output"` -} - -type Source struct { - Name string `json:"name"` - URL string `json:"url"` - Layer string `json:"layer,omitempty"` - Format string `json:"format"` - Schema string `json:"schema"` -} - -type Schedule struct { - Mode ScheduleMode `json:"mode"` - RunAt string `json:"runAt,omitempty"` -} - -type Output struct { - Format OutputFormat `json:"format"` - Package PackageFormat `json:"package"` -} - -type TaskDefinition struct { - Name string - Mode area.Mode - Area area.Spec - Sources []Source - Zoom area.ZoomRange - Schedule Schedule - RunAt *time.Time - Output Output -} - -func NormalizeRequest(req Request) (*TaskDefinition, error) { - name := strings.TrimSpace(req.Name) - if name == "" { - return nil, errors.New("name is required") - } - if len(name) > 80 { - return nil, errors.New("name must be 80 characters or fewer") - } - - normalizedArea, err := area.Normalize(req.Area, req.Mode) - if err != nil { - return nil, err - } - if err := req.Zoom.Validate(); err != nil { - return nil, err - } - - sources, err := normalizeSources(req.Sources) - if err != nil { - return nil, err - } - schedule, runAt, err := normalizeSchedule(req.Schedule) - if err != nil { - return nil, err - } - output, err := normalizeOutput(req.Output) - if err != nil { - return nil, err - } - - return &TaskDefinition{ - Name: name, - Mode: normalizedArea.Mode, - Area: normalizedArea, - Sources: sources, - Zoom: req.Zoom, - Schedule: schedule, - RunAt: runAt, - Output: output, - }, nil -} - -func normalizeSources(input []Source) ([]Source, error) { - if len(input) == 0 { - return nil, errors.New("at least one source is required") - } - sources := make([]Source, 0, len(input)) - for _, source := range input { - source.Name = strings.TrimSpace(source.Name) - source.URL = strings.TrimSpace(source.URL) - source.Layer = strings.TrimSpace(source.Layer) - source.Format = strings.ToLower(strings.TrimSpace(source.Format)) - source.Schema = strings.ToLower(strings.TrimSpace(source.Schema)) - if source.URL == "" { - return nil, errors.New("source url is required") - } - if source.Name == "" { - if source.Layer != "" { - source.Name = source.Layer - } else { - source.Name = source.URL - } - } - if !supportedFormat(source.Format) { - return nil, errors.New("unsupported source format") - } - if source.Schema == "" { - source.Schema = "xyz" - } - if source.Schema != "xyz" && source.Schema != "tms" { - return nil, errors.New("source schema must be xyz or tms") - } - sources = append(sources, source) - } - return sources, nil -} - -func normalizeSchedule(input Schedule) (Schedule, *time.Time, error) { - input.Mode = ScheduleMode(strings.ToLower(strings.TrimSpace(string(input.Mode)))) - if input.Mode == "" { - input.Mode = ScheduleImmediate - } - switch input.Mode { - case ScheduleImmediate: - input.RunAt = "" - return input, nil, nil - case ScheduleOnce: - input.RunAt = strings.TrimSpace(input.RunAt) - if input.RunAt == "" { - return Schedule{}, nil, errors.New("runAt is required for scheduled tasks") - } - parsed, err := time.Parse(time.RFC3339, input.RunAt) - if err != nil { - return Schedule{}, nil, errors.New("runAt must be RFC3339 time") - } - return input, &parsed, nil - default: - return Schedule{}, nil, errors.New("unsupported schedule mode") - } -} - -func normalizeOutput(input Output) (Output, error) { - input.Format = OutputFormat(strings.ToLower(strings.TrimSpace(string(input.Format)))) - if input.Format == "" { - input.Format = OutputMBTiles - } - if input.Format != OutputFiles && input.Format != OutputMBTiles { - return Output{}, errors.New("output format must be files or mbtiles") - } - input.Package = PackageFormat(strings.ToLower(strings.TrimSpace(string(input.Package)))) - if input.Package == "" { - input.Package = PackageZIP - } - if input.Package != PackageZIP && input.Package != PackageTarGZ { - return Output{}, errors.New("output package must be zip or tar.gz") - } - return input, nil -} - -func supportedFormat(format string) bool { - switch format { - case "jpg", "png", "pbf", "webp": - return true - default: - return false - } -} diff --git a/apps/admin-region-tiler/internal/planner/model_test.go b/apps/admin-region-tiler/internal/planner/model_test.go deleted file mode 100644 index a57c741..0000000 --- a/apps/admin-region-tiler/internal/planner/model_test.go +++ /dev/null @@ -1,89 +0,0 @@ -package planner - -import ( - "testing" - - "tiler/internal/area" -) - -func TestNormalizeRequestBBox(t *testing.T) { - definition, err := NormalizeRequest(Request{ - Name: " Range task ", - Mode: area.ModeBBox, - Area: area.Spec{BBox: &area.BBox{MinLon: 100, MinLat: 20, MaxLon: 101, MaxLat: 21}}, - Zoom: area.ZoomRange{Min: 1, Max: 3}, - Sources: []Source{{ - URL: "https://example.test/{z}/{x}/{y}.png", - Layer: "img", - Format: "PNG", - }}, - }) - if err != nil { - t.Fatalf("NormalizeRequest returned error: %v", err) - } - if definition.Name != "Range task" { - t.Fatalf("unexpected name: %q", definition.Name) - } - if definition.Mode != area.ModeBBox || definition.Area.BBox == nil { - t.Fatalf("unexpected area: %#v", definition.Area) - } - if definition.Sources[0].Schema != "xyz" || definition.Sources[0].Format != "png" { - t.Fatalf("unexpected source normalization: %#v", definition.Sources[0]) - } - if definition.Schedule.Mode != ScheduleImmediate { - t.Fatalf("unexpected schedule: %#v", definition.Schedule) - } - if definition.Output.Format != OutputMBTiles || definition.Output.Package != PackageZIP { - t.Fatalf("unexpected output: %#v", definition.Output) - } -} - -func TestNormalizeRequestRegion(t *testing.T) { - definition, err := NormalizeRequest(Request{ - Name: "Region task", - Mode: area.ModeRegion, - Area: area.Spec{RegionID: "china"}, - Zoom: area.ZoomRange{Min: 6, Max: 8}, - Sources: []Source{{ - Name: "vec", - URL: "https://example.test/{z}/{x}/{y}.png", - Format: "png", - Schema: "tms", - }}, - }) - if err != nil { - t.Fatalf("NormalizeRequest returned error: %v", err) - } - if definition.Mode != area.ModeRegion || definition.Area.RegionID != "china" { - t.Fatalf("unexpected region definition: %#v", definition) - } -} - -func TestNormalizeRequestRejectsMissingSource(t *testing.T) { - _, err := NormalizeRequest(Request{ - Name: "missing source", - Mode: area.ModeRegion, - Area: area.Spec{GeoJSON: "./geojson/china.geojson"}, - Zoom: area.ZoomRange{Min: 1, Max: 2}, - }) - if err == nil { - t.Fatal("expected missing source error") - } -} - -func TestNormalizeRequestRejectsScheduledWithoutRunAt(t *testing.T) { - _, err := NormalizeRequest(Request{ - Name: "scheduled", - Mode: area.ModeRegion, - Area: area.Spec{GeoJSON: "./geojson/china.geojson"}, - Zoom: area.ZoomRange{Min: 1, Max: 2}, - Sources: []Source{{ - URL: "https://example.test/{z}/{x}/{y}.png", - Format: "png", - }}, - Schedule: Schedule{Mode: ScheduleOnce}, - }) - if err == nil { - t.Fatal("expected runAt error") - } -} diff --git a/apps/admin-region-tiler/internal/web/doc.go b/apps/admin-region-tiler/internal/web/doc.go deleted file mode 100644 index 3e89b32..0000000 --- a/apps/admin-region-tiler/internal/web/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package web will hold helpers for the unified static frontend. -package web diff --git a/apps/admin-region-tiler/static/assets/icons/calendar.svg b/apps/admin-region-tiler/static/assets/icons/calendar.svg deleted file mode 100644 index ca2462a..0000000 --- a/apps/admin-region-tiler/static/assets/icons/calendar.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/apps/admin-region-tiler/static/assets/icons/clock.svg b/apps/admin-region-tiler/static/assets/icons/clock.svg deleted file mode 100644 index ec5c2d0..0000000 --- a/apps/admin-region-tiler/static/assets/icons/clock.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/apps/admin-region-tiler/static/assets/icons/error.svg b/apps/admin-region-tiler/static/assets/icons/error.svg deleted file mode 100644 index 9aa1d55..0000000 --- a/apps/admin-region-tiler/static/assets/icons/error.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/apps/admin-region-tiler/static/assets/icons/filter.svg b/apps/admin-region-tiler/static/assets/icons/filter.svg deleted file mode 100644 index c085aff..0000000 --- a/apps/admin-region-tiler/static/assets/icons/filter.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/apps/admin-region-tiler/static/assets/icons/folder.svg b/apps/admin-region-tiler/static/assets/icons/folder.svg deleted file mode 100644 index 239fc83..0000000 --- a/apps/admin-region-tiler/static/assets/icons/folder.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/apps/admin-region-tiler/static/assets/icons/pause.svg b/apps/admin-region-tiler/static/assets/icons/pause.svg deleted file mode 100644 index 4058efb..0000000 --- a/apps/admin-region-tiler/static/assets/icons/pause.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/apps/admin-region-tiler/static/assets/icons/play.svg b/apps/admin-region-tiler/static/assets/icons/play.svg deleted file mode 100644 index 30788fe..0000000 --- a/apps/admin-region-tiler/static/assets/icons/play.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/apps/admin-region-tiler/static/assets/icons/search.svg b/apps/admin-region-tiler/static/assets/icons/search.svg deleted file mode 100644 index 15ed8e4..0000000 --- a/apps/admin-region-tiler/static/assets/icons/search.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/apps/admin-region-tiler/static/assets/logo/logo.svg b/apps/admin-region-tiler/static/assets/logo/logo.svg deleted file mode 100644 index 2a48f00..0000000 --- a/apps/admin-region-tiler/static/assets/logo/logo.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - 地图图片下载中心 - 计划任务,定时批量下载地图图片 - diff --git a/apps/admin-region-tiler/static/favicon.svg b/apps/admin-region-tiler/static/favicon.svg deleted file mode 100644 index 2d17039..0000000 --- a/apps/admin-region-tiler/static/favicon.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/apps/admin-region-tiler/static/test.html b/apps/admin-region-tiler/static/test.html deleted file mode 100644 index 2601ef4..0000000 --- a/apps/admin-region-tiler/static/test.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - 测试页面 - - -

测试页面

- - -

- -

-
- - - - \ No newline at end of file diff --git a/docs/ai-operating-handbook.md b/docs/ai-operating-handbook.md index a183fa7..0735684 100644 --- a/docs/ai-operating-handbook.md +++ b/docs/ai-operating-handbook.md @@ -137,12 +137,10 @@ Current-session tool evidence wins over configured inventory. Use PowerShell, `rg` after confirming it runs, and `apply_patch` for local edits. Treat unexposed or replaced plugins as fallback routes, not hard dependencies. -## Next Enhancement Queue - -1. Add browser automation for range-mode and region-mode smoke tests when a - local Playwright or equivalent dependency is available. -2. Continue reducing legacy `plans` naming after compatibility is no longer - needed. -3. Improve failure retry UX on top of persisted failure records. -4. Handle global overgrown system skills, such as `imagegen`, in a separate - global-control tranche so repo guidance remains focused. +## Maintenance Priorities + +Browser automation and cumulative failure retries are implemented and covered +by the validation chain. Use [the maintenance audit](maintenance-audit-2026-09-11.md) +for remaining work instead of recreating completed tasks. Keep legacy `plans` +tables while compatibility still depends on them. Global environment work is +outside repository maintenance. diff --git a/docs/automation-guardrails.md b/docs/automation-guardrails.md index 30f3e7f..9686571 100644 --- a/docs/automation-guardrails.md +++ b/docs/automation-guardrails.md @@ -36,7 +36,7 @@ Facts: - Start from AGENTS.md, docs/project-map.md, docs/done-definition.md, docs/ai-operating-handbook.md, and git status. - Confirm the repository only contains the in-scope app under apps/admin-region-tiler. - Confirm retired .NET range downloader runtime code has not reappeared. -- Check for drift between README.md, PROJECT_MANIFEST.md, RELEASE_HANDOFF_PROMPT.md, LICENSE, and docs/merge-plan.md. +- Check for drift between README.md, PROJECT_MANIFEST.md, docs/long-term-memory.md, LICENSE, and docs/merge-plan.md. - Check that docs/knowledge-graph.md still names the current single-app architecture and AI control surfaces. - Check that docs/long-term-memory.md still follows the handoff contract if it exists. - Check for sensitive token or password literals, allowing documented placeholders and the documented development default admin password only. @@ -67,7 +67,7 @@ python C:\Users\32674\.codex\skills\deep-execution-upgrade\scripts\audit_environ ``` ```powershell -rg -n "Apache|MIT|License|许可证|许可" README.md PROJECT_MANIFEST.md RELEASE_HANDOFF_PROMPT.md docs LICENSE +rg -n "Apache|MIT|License|许可证|许可" README.md PROJECT_MANIFEST.md docs LICENSE ``` ```powershell diff --git a/docs/github-growth-playbook.md b/docs/github-growth-playbook.md index 9efa342..d29a41f 100644 --- a/docs/github-growth-playbook.md +++ b/docs/github-growth-playbook.md @@ -1,5 +1,9 @@ # GitHub Star Conversion Playbook +> Historical promotion plan. The release checklist below still targets v0.1.0 +> and is not a validated procedure for current releases. See the +> [maintenance audit](maintenance-audit-2026-09-11.md) before reusing it. + This playbook is the first-stage execution guide for improving Map Tile Fetcher conversion from repository visitor to star. It is intentionally focused on Chinese GIS and map-development audiences. diff --git a/docs/long-term-memory.md b/docs/long-term-memory.md index 61f4969..7e1282c 100644 --- a/docs/long-term-memory.md +++ b/docs/long-term-memory.md @@ -2,6 +2,13 @@ ## Facts +- 2026-09-11 repository cleanup: removed 24 redundant docs, unused package + scaffolding, unreferenced static files and a generated report. Actual region + geometry, runtime compatibility tables and active UI/test assets remain. + `docs/maintenance-audit-2026-09-11.md` records the deletion evidence and seven + unresolved maintenance issues, including five confirmed missing region files. +- README follow-up PR #4 merged as `37cfe7c`; its main CI passed and the + temporary `codex/readme-sync` branch was removed locally and remotely. - 2026-09-11 README follow-up: root documentation now covers repair behavior, limits, legacy handling and validation. Source/binary runs read process environment variables, not `.env` automatically; initial credentials do not @@ -55,8 +62,9 @@ ## Decisions -- Keep `main` as the only long-term branch. Merge the validated PR #3 head and - remove `agent/audit-hardening` only after the resulting main CI succeeds. +- Keep `main` as the only long-term branch. PR #3 and its branch cleanup are + complete. For future batches, merge the checked PR head and remove its + temporary branch only after the resulting main CI succeeds. - Defaults: 1,000,000 tiles per parent across sources, three active children, paused children retaining their slot, and three requested workers (1-50). - Preserve legacy records and artifacts; reconcile explicitly without tile @@ -157,8 +165,9 @@ ## Next Action -- For this delivery, verify the final PR head checks, merge with the validated - bilingual message, wait for main CI, and remove only the fully merged repair - branch. Use live GitHub state to determine whether these steps are complete. +- Use `docs/maintenance-audit-2026-09-11.md` for remaining issues. Start with + region maintenance script data preservation and geometry correctness, then + existing-user password rotation. Check live GitHub state for any pending + cleanup PR before creating a duplicate batch. - Before any future release, rerun preflight and verify `main` CI. Plan a separate, explicitly authorized deployment and database backup/copy validation. diff --git a/docs/maintenance-audit-2026-09-11.md b/docs/maintenance-audit-2026-09-11.md new file mode 100644 index 0000000..f7d6563 --- /dev/null +++ b/docs/maintenance-audit-2026-09-11.md @@ -0,0 +1,70 @@ +# 仓库清理与待处理清单 + +检查日期:2026-09-11。基线:`37cfe7c`(README 同步后的 `main`)。 +本轮检查仓库文件用途、代码导入、静态资源引用、文档一致性和维护脚本。 +清理不执行生产部署、区域下载或生产数据修改,不等同于重新审计全部业务逻辑。 + +## 已清理 + +共删除 24 个文件,Git 历史保留其原内容。 + +| 对象 | 原问题与处理依据 | +| --- | --- | +| `README_ZH.md`、应用目录 `README-EN.md` | 根 README 已有中英文入口;两个副本缺少新行为且产生启动说明漂移,删除副本。 | +| `RELEASE_HANDOFF_PROMPT.md` | 一次性交接提示仍要求中英文 README 分开,现有项目地图、验证链路和长期交接已覆盖其用途;删除并更新自动审查引用。 | +| 应用目录 `CHANGES.md` | 仅有 2022 年 `timedelay` 说明且使用旧 `works` 参数,不是当前变更记录;删除,当前规则见 README 和配置。 | +| `static/test.html` | 仅测试按钮事件,无应用或回归测试引用;原先随整个 `static/` 发布,现已删除。 | +| `internal/api`、`auth`、`config`、`artifact`、`web` 的 5 个 `doc.go` | 只有“将来负责”的说明,无实现或导入;删除空包,文档改为真实代码职责。 | +| `internal/planner` 的 3 个文件 | 只有自身测试引用,主应用不调用;重复校验已经与真实 API 的名称长度规则不一致。删除未接入代码及其测试,保留真实 API 集成测试。 | +| 10 个静态资源 | 8 个无调用图标:`calendar`、`clock`、`error`、`filter`、`folder`、`pause`、`play`、`search`;另有旧 `static/favicon.svg`、未使用的 `assets/logo/logo.svg`。已核对 HTML/CSS 直接引用及 JS 动态图标分支。 | +| `geojson/materialize-report.json` | 一次性生成结果,不是区域数据;其中缺失项转录并重新核实如下,生成报告加入 Git 和 Docker 忽略规则。 | + +同时修正:应用架构说明、源码与 systemd 配置说明、部署前初始账号要求、删除范围、 +PR #3/#4 已完成状态,以及 AI 手册中已经完成的待办。历史发布草稿和推广方案加上 +过时标记;这些文件仍有历史或推广用途,未整份删除。 + +## 待处理问题 + +优先级 P1 表示执行相关维护操作前应处理,P2 表示下一轮维护应补齐。 +以下均未在本轮修改业务实现,不能因清理或现有测试通过而视为已解决。 + +| 编号 | 优先级 | 已确认事实与影响 | 处理建议与验收 | +| --- | --- | --- | --- | +| M1 | P1 | [区域镜像脚本](../apps/admin-region-tiler/scripts/materialize_geojson_from_mirror.py) 的 `sync_to_deploy` 对目标 `geojson/` 先执行 `shutil.rmtree` 再复制;没有引用核对,启用 `--deploy-root` 会整目录替换现有文件。 | 改为有路径约束、备份及差异清单的发布过程;保护任务生成和自定义文件,复制失败可恢复。用临时目录验证,不能直接在生产试运行。 | +| M2 | P1 | [区域下载脚本](../apps/admin-region-tiler/scripts/download_aliyun_geojson.py) 在城市请求 404 时复制父区域文件或下载父区域,仍写入子区域路径;文件存在不代表范围正确,后续下载可能扩大到父区域。 | 缺失区域显式失败;仅在能从数据中按行政编码提取目标几何时落盘。模拟 404,核对编码和几何,不能以父区域代替。 | +| M3 | P1 | [初始用户创建](../apps/admin-region-tiler/db.go) 遇到同名用户直接返回;[API 路由](../apps/admin-region-tiler/server.go) 没有改密接口。已使用默认账号初始化的实例不能通过改环境变量轮换密码。原部署文档“上线后修改”已纠正,但功能缺口仍在。 | 增加受认证的密码修改流程或明确的离线恢复命令,保留任务归属并撤销旧会话;验证旧密码失效、其他用户不受影响。 | +| M4 | P2 | [区域目录](../apps/admin-region-tiler/geojson/regions.json) 有 3227 项,其中 5 项引用的文件不存在,详见下表。服务会把它们归入 `missing`,对应区域无法直接选择下载。 | 从明确来源补齐并校验几何和行政编码;若无法取得准确边界,继续标记缺失,不能用近似区域替代。 | +| M5 | P2 | [main.go](../apps/admin-region-tiler/main.go) 帮助文本及默认版本、[conf.toml](../apps/admin-region-tiler/conf.toml) 仍写 `0.1.0`;仓库发布预览为 `v0.3.0`,当前修复又在其后。版本显示无法准确识别构建。 | 建立单一构建版本来源,包含 tag/commit;开发构建明确标记,检查帮助、服务元信息和发布包一致。不要仅手改版本号伪装为新发布。 | +| M6 | P2 | [旧发布步骤](github-growth-playbook.md) 写死 `v0.1.0`,使用未定义的 `$winDir`/`$linuxDir`;打包二进制名为 `map-tile-fetcher`,而 [systemd 模板](../apps/admin-region-tiler/deploy/systemd/tiler.service) 运行 `/opt/tiler/tiler`。 | 将可复现构建打包过程从推广方案提取成脚本,统一二进制名、版本、资源与校验和;在新目录解压后验证启动。当前历史步骤已标记不可直接照用。 | +| M7 | P2 | 两个区域维护脚本缺少依赖锁定和回归验证;镜像脚本直接依赖 Shapely,下载脚本遇到错误仅打印报告,进程仍可成功退出;`--limit` 说明称 dry run 但仍实际下载写盘。 | 建立独立维护工具依赖及测试,明确只检查与写入模式,失败返回非零退出码;使用本地模拟服务验证,不触达真实服务。 | + +### 已核实的区域缺口 + +仅解析区域目录并检查路径是否存在,没有读取或重写全部几何数据。 + +| 行政编码 | 区域 | +| --- | --- | +| 460323 | 中沙群岛的岛礁及其海域 | +| 653228 | 和康县 | +| 653229 | 和安县 | +| 659011 | 新星市 | +| 659012 | 白杨市 | + +## 保留依据 + +- `internal/area`、`internal/downloader` 被主应用直接调用,保留实现和测试。 +- `plans`、旧运行与关联表仍参与兼容迁移、查询及删除,不能因为名称旧就删除。 +- `geojson/` 的真实区域资源、Leaflet 及其图标、页面正在引用的 SVG 和 README 图片均保留。 +- 区域维护脚本有数据重建用途,保留并列出缺陷;本轮未执行其下载或同步动作。 +- `AGENTS.md`、项目地图、验证链路、交接和本地技能仍有明确规则及引用,保留。 +- 本地忽略目录与运行数据不属于本轮 Git 文件清理;没有执行临时目录的递归删除。 + +## 验证路径 + +删除前核对 tracked 文件、导入关系、静态资源的直接和动态引用;清理后执行完整 +`node scripts/release_preflight.mjs`、`go vet ./...`、文档链接与静态资源存在性检查、 +仓库审计、交接校验和 `git diff --check`。精确通过记录写入本批双语提交正文, +Linux `go test -race ./...` 由 PR 和合并后 `main` CI 验证。 + +后续实施优先处理 M1/M2 的区域维护工具,再处理 M3 的账号轮换;M4 需要可靠区域 +数据来源,M5/M6 应随下一次正式发布一并收敛,M7 与维护工具修复一起验证。 diff --git a/docs/merge-plan.md b/docs/merge-plan.md index d77177f..60ea784 100644 --- a/docs/merge-plan.md +++ b/docs/merge-plan.md @@ -44,9 +44,13 @@ Keep `apps/admin-region-tiler` as the base for: ## Branch Convergence -`main` is the only long-term branch. The full repair delivery uses existing -PR #3 and `agent/audit-hardening`, with validated bilingual commits per batch. -Keep strict required checks (`Commit Message`, `Admin Region Tiler`) enabled. -Merge only the checked PR head with a complete bilingual merge message, wait -for the resulting `main` CI, then remove the repair branch and synchronize the -local checkout. Preserve historical CI failures and commit history. +`main` is the only long-term branch. PR #3 was merged as `8b0933b`; its main CI +passed and `agent/audit-hardening` was deleted. README follow-up PR #4 was merged +as `37cfe7c`, with main CI passing and its temporary branch removed. + +For future batches, keep strict required checks (`Commit Message`, +`Admin Region Tiler`) enabled. Merge only the checked PR head with a complete +bilingual merge message, wait for the resulting `main` CI, then remove that +temporary branch and synchronize the local checkout. Preserve historical CI +failures and commit history. Current cleanup findings are tracked in +[the maintenance audit](maintenance-audit-2026-09-11.md). diff --git a/docs/project-map.md b/docs/project-map.md index 8c4c468..1a6316d 100644 --- a/docs/project-map.md +++ b/docs/project-map.md @@ -31,13 +31,12 @@ Out of scope unless the user explicitly changes direction: manager, and HTTP server - supports worker mode via runtime flags/environment - `internal/` - - package boundaries for API, auth, config, area selection, planning, - downloading, artifacts, and static Web helpers + - the two implemented packages shared by the main application - `internal/area` validates bbox and region area selectors plus zoom ranges - - `internal/planner` normalizes unified task requests before persistence or - execution - `internal/downloader` contains bbox tile math shared by API validation and range UI estimates + - task normalization, authentication and artifact management remain in the + main package; unused extraction scaffolding has been removed - `server.go` - Gin routes for login, current user, task CRUD, task control, artifact download, failure records, map source config, region catalog, and GeoJSON @@ -142,8 +141,10 @@ See `docs/range-migration.md` for the historical note. - Source-of-truth license: Apache License 2.0 in `LICENSE` and `README.md`. - Safe token placeholders include `YOUR_TIANDITU_TOKEN`, `YOUR_MAPBOX_TOKEN`, and `YOUR_MAPBOX_SKU`. -- `adminmap` is a documented development default password; production must use - `.env` overrides. +- `adminmap` is a documented development default password. Configure initial + production credentials before the first start through process environment + variables or local configuration; Docker injects `.env`. Existing users are + not reset by changing initial-user settings. - Generated or local-only paths stay out of Git: `.env`, `data/`, `output/`, `tiles/`, `bin/`, `obj/`, `publish*/`, logs, binaries, and archives. - Browser UI smoke validation uses an optional local or global browser @@ -163,6 +164,7 @@ See `docs/range-migration.md` for the historical note. | `docs/knowledge-graph.md` | Durable relationship graph | When recovering context or avoiding broad re-exploration | | `docs/long-term-memory.md` | Handoff-style restart state | Long-running, merge, release, or AI-control work | | `docs/automation-guardrails.md` | Read-only recurring review constraints | Automation prompt creation or review | +| `docs/maintenance-audit-2026-09-11.md` | Cleanup decisions and remaining maintenance issues | Before deleting more files or planning follow-up fixes | ## Context Loading Order diff --git a/docs/releases/v0.1.0.md b/docs/releases/v0.1.0.md index cc86633..3820ccd 100644 --- a/docs/releases/v0.1.0.md +++ b/docs/releases/v0.1.0.md @@ -1,5 +1,9 @@ # v0.1.0 Release Notes +> Historical release draft, retained for provenance. Version names, startup +> instructions and planned assets below are not the current release procedure. +> 当前安装配置见 [README](../../README.md),历史版本记录不代表当前主分支行为。 + Release date: 2026-06-29 这是 Map Tile Fetcher 合并为单一 Go Web 应用后的第一个开源预览版本。