Skip to content

Commit f0da3fc

Browse files
committed
refactor: make catalog repository data-only
1 parent a0a5e8b commit f0da3fc

62 files changed

Lines changed: 1555 additions & 1872 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ Describe the problem, the change, and the reader or maintainer outcome.
66

77
- [ ] Catalog resource or classification
88
- [ ] Bilingual editorial content
9-
- [ ] Site or build code
9+
- [ ] Catalog export or consumer contract
1010
- [ ] Tests, tooling, or workflow
1111
- [ ] Governance or documentation
1212

1313
## Evidence and scope
1414

1515
- Related issue:
1616
- Source or maintenance evidence:
17-
- User-visible pages affected:
17+
- Website consumer impact:
1818
- Intentionally out of scope:
1919

2020
For catalog changes, explain the official source, review date, license or
@@ -27,8 +27,7 @@ List the actual results, not only the commands you intended to run.
2727

2828
- [ ] `python -m pytest`
2929
- [ ] `python tools/validate_catalog.py`
30-
- [ ] `bundle exec jekyll build`
31-
- [ ] `bundle exec ruby tests/render_security_test.rb`
30+
- [ ] `python tools/export_catalog.py --check`
3231
- [ ] English and Chinese output remain consistent
3332
- [ ] No secrets, generated reports, local build output, or analytics IDs were committed
3433

.github/dependabot.yml

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
version: 2
22
updates:
3-
- package-ecosystem: bundler
4-
directory: "/"
5-
schedule:
6-
interval: weekly
7-
day: monday
8-
time: "09:00"
9-
timezone: Asia/Shanghai
10-
open-pull-requests-limit: 5
11-
groups:
12-
jekyll-dependencies:
13-
patterns:
14-
- "github-pages"
15-
- "jekyll-*"
16-
173
- package-ecosystem: pip
184
directory: "/"
195
schedule:
206
interval: weekly
217
day: monday
22-
time: "09:15"
8+
time: "09:00"
239
timezone: Asia/Shanghai
2410
open-pull-requests-limit: 5
2511
groups:
@@ -32,7 +18,7 @@ updates:
3218
schedule:
3319
interval: weekly
3420
day: monday
35-
time: "09:30"
21+
time: "09:15"
3622
timezone: Asia/Shanghai
3723
open-pull-requests-limit: 5
3824
groups:

.github/workflows/validate.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,5 @@ jobs:
3636
- name: Validate catalog
3737
run: python tools/validate_catalog.py
3838

39-
- name: Set up Ruby and Bundler
40-
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
41-
with:
42-
bundler-cache: true
43-
44-
- name: Build Jekyll site
45-
run: bundle exec jekyll build
46-
47-
- name: Verify catalog output escaping
48-
run: bundle exec ruby tests/render_security_test.rb
39+
- name: Verify public JSON export
40+
run: python tools/export_catalog.py --check

.gitignore

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
# Jekyll
2-
_site/
3-
.sass-cache/
4-
.jekyll-cache/
5-
.jekyll-metadata
6-
7-
# Ruby
8-
.bundle/
9-
vendor/
10-
111
# OS
122
.DS_Store
133
.DS_Store?

.ruby-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

AGENTS.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,43 @@
22

33
## Mission
44

5-
This repository is the broad, community-maintained resource catalog behind
6-
FlyPython. Keep `flypython.com` focused on editorial learning paths and a small
7-
featured set; keep this repository focused on the larger reviewed catalog and
8-
its contribution workflow.
5+
This repository is the broad, community-maintained data catalog behind
6+
FlyPython. It is not a website. Keep `flypython.com` focused on editorial
7+
learning paths, task playbooks, and presentation; keep this repository focused
8+
on reviewed catalog data, its public JSON contract, and its contribution
9+
workflow.
910

1011
## Content rules
1112

1213
- Prefer official documentation and primary sources.
13-
- Every catalog entry must include a stable ID, path, source type, level,
14-
rationale, review date, status, and any key or safety requirements.
14+
- Every catalog entry must include a stable ID, path, path-local order, source
15+
type, level, rationale, review date, status, and any key or safety requirements.
1516
- Do not call a project production-ready without current maintenance, licensing,
1617
security, and adoption evidence.
1718
- Do not use an LLM or web-search API to generate resource descriptions.
1819
Descriptions and classifications require human review.
19-
- Keep English and Chinese pages generated from the same canonical resource
20-
data. Do not hand-copy the full catalog into multiple Markdown files.
20+
- Keep English and Chinese website output generated from the same canonical
21+
resource data. Do not hand-copy catalog content into website source files.
2122
- Treat HTTP 403, 429, and transient 5xx responses as review-needed states, not
2223
automatic proof that a resource is broken.
2324

2425
## Change workflow
2526

2627
- Work on a feature branch and preserve unrelated contributor changes.
2728
- Run the repository validation workflow before committing.
29+
- Regenerate `catalog.json` after source changes and verify it with
30+
`python tools/export_catalog.py --check`.
31+
- Website consumers must pin a full repository commit and verify the catalog
32+
checksum. Do not make production builds depend on a moving branch.
2833
- Keep external-link checks read-only, rate-limited, retryable, and blocked from
2934
private or loopback network targets.
3035
- Do not add API keys, tokens, analytics IDs, or generated reports to git.
31-
- After merge, verify the GitHub Pages deployment and the production domain.
36+
- After merge, verify the immutable raw `catalog.json`. Verify flypython.com only
37+
after a separate, deliberate consumer-version update.
3238

3339
## Review priorities
3440

3541
1. Content accuracy and source quality.
36-
2. Deterministic generation and bilingual parity.
37-
3. Build, schema, link, accessibility, and SEO checks.
42+
2. Deterministic export and bilingual parity.
43+
3. Schema, consumer-contract, and safe link checks.
3844
4. Clear contribution and licensing boundaries.

CHANGELOG.md

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,33 @@
11
# Changelog
22

3-
This file records notable repository and catalog-process changes. The Git
4-
history remains the source for changes made before this changelog was added.
3+
This file records notable catalog-contract and maintenance changes.
54

65
## [Unreleased]
76

87
### Added
98

10-
- A single bilingual catalog source with 21 reviewed primary resources across
11-
Python foundations, web and APIs, automation, and AI-agent paths.
12-
- Catalog schema validation and a safe external-link auditor with tests,
13-
retry/backoff behavior, JSON reports, and SSRF/DNS-rebinding protection.
14-
- English and Chinese catalog pages generated from the same resource data,
15-
plus a 1200x630 social preview image.
16-
- Contribution, conduct, security, and resource-curation policies.
17-
- Structured issue forms and a pull request review checklist.
18-
- Dependency update configuration and validation workflows.
19-
- Scheduled, manually dispatchable catalog-link auditing that does not run on
20-
untrusted pull requests.
9+
- One source file per reviewed resource under `catalog/resources/`.
10+
- A deterministic, versioned `catalog.json` export for pinned website consumers.
11+
- A JSON Schema describing the public catalog v1 contract.
12+
- A pinned-revision and checksum contract for website consumers.
13+
- Export drift checks in tests and pull-request validation.
14+
- Positive, unique, consecutive ordering within each learning path.
15+
- Catalog validation and a safe external-link auditor with retry, report, and
16+
SSRF/DNS-rebinding protection.
17+
- Contribution, conduct, security, issue, and resource-curation policies.
2118

2219
### Changed
2320

24-
- Reframed the repository as the broad, community-maintained catalog behind
25-
FlyPython while keeping the README files as short entry points.
26-
- Pinned the Python 3.12 and Ruby 3.3 build toolchains and their validation
27-
dependencies for reproducible local and CI checks.
28-
29-
### Fixed
30-
31-
- Corrected repository links, dynamic resource counts, bilingual metadata,
32-
canonical and hreflang output, robots rules, and duplicate heading/meta tags.
33-
- Escaped catalog-controlled HTML output, audited same-origin catalog links,
34-
and made review-needed network results fail the scheduled audit.
21+
- Defined this repository as the canonical catalog-data and review layer behind
22+
flypython.com, rather than a second public website.
23+
- Split catalog metadata, paths, and resources into independently reviewable
24+
files while preserving the 21 existing human-reviewed resource records.
25+
- Required website consumers to pin a full repository commit and verify the
26+
exported catalog checksum instead of following a moving branch.
27+
- Reduced the required local toolchain to Python 3.12 and locked Python
28+
dependencies.
3529

3630
### Removed
3731

38-
- Removed the legacy `README_cn` site route without adding a redirect, along
39-
with unused feed, navigation, collection, theme, and inline-style config.
32+
- Removed Jekyll, Ruby, page templates, styles, scripts, social assets, CNAME,
33+
robots configuration, and site-rendering tests.

CNAME

Lines changed: 0 additions & 1 deletion
This file was deleted.

CONTRIBUTING.md

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,102 +1,102 @@
1-
# Contributing to FlyPython
1+
# Contributing to the FlyPython catalog
22

3-
FlyPython is a bilingual, reviewed catalog of durable Python and AI-agent
4-
resources. Contributions should improve accuracy, source quality, or the
5-
catalog workflow. General Python questions belong in
6-
[GitHub Discussions](https://github.com/flypythoncom/python/discussions).
3+
FlyPython maintains a bilingual, reviewed source catalog used by
4+
[flypython.com](https://flypython.com/). Contributions should improve source
5+
quality, factual accuracy, or the maintenance workflow. General Python questions
6+
belong in [GitHub Discussions](https://github.com/flypythoncom/python/discussions).
77

8-
Before contributing, read the [curation policy](docs/CURATION_POLICY.md).
8+
Read the [curation policy](docs/CURATION_POLICY.md) before contributing.
99

1010
## Permissions
1111

12-
This repository currently does not grant a general license to reuse its
13-
content or code. Public visibility is not permission to copy, redistribute,
14-
or relicense repository material. Contributors must submit only material
15-
they have the right to submit and must preserve any required third-party
16-
notices. A contribution does not change the terms of third-party material.
12+
This repository currently does not grant a general license to reuse its content
13+
or code. Public visibility is not permission to copy, redistribute, or relicense
14+
repository material. Contributors must submit only material they have the right
15+
to submit and retain required third-party notices.
1716

1817
## Propose a change
1918

2019
Use the matching issue form before a larger change:
2120

22-
- **Resource proposal** for a new catalog entry.
21+
- **Resource proposal** for a new official source.
2322
- **Broken link** for an unreachable or replaced resource.
24-
- **Security report** for a vulnerability. Follow [SECURITY.md](SECURITY.md)
23+
- **Security report** for a vulnerability; follow [SECURITY.md](SECURITY.md)
2524
instead of opening a public issue.
2625

27-
Small typo, metadata, or maintenance fixes may go directly to a pull request.
28-
Keep each pull request focused on one purpose.
26+
Small typo, metadata, or tooling fixes may go directly to a focused pull request.
2927

30-
## Catalog changes
28+
## Catalog sources
3129

32-
`_data/resources.yml` is the canonical catalog source. Do not add or change a
33-
resource only in a rendered Markdown page.
30+
The canonical source is the `catalog/` directory:
3431

35-
Each resource entry must include these fields:
32+
- `catalog/catalog.yml` contains catalog-level review state.
33+
- `catalog/paths.yml` defines the four bilingual learning paths.
34+
- `catalog/resources/<id>.yml` contains one reviewed resource.
35+
- `catalog.json` is generated output and must not be edited by hand.
3636

37-
- `id`, `path`, `title`, and `url`
37+
Every resource file must include:
38+
39+
- `id`, `path`, `order`, `title`, and `url`
3840
- `source_type`, `level`, and `language`
3941
- `why_en` and `why_zh`
4042
- `reviewed_on` and `status`
4143
- `requires_key`, `risk`, and `featured`
4244

45+
The filename must match the stable resource ID. Resource `order` values must be
46+
unique and consecutive within each path.
47+
4348
Descriptions and classifications require human review. Do not use an LLM or a
4449
web-search API to generate them. Prefer official documentation, official
4550
standards, and official project pages.
4651

47-
A 403, 429, or transient 5xx response is not enough to delete a resource. Mark
48-
it for review and provide repeatable evidence.
52+
A 403, 429, timeout, or transient 5xx response is not enough to delete a
53+
resource. Mark it for human review and provide repeatable evidence.
4954

5055
## Local setup
5156

52-
Install the exact Python version from `.python-version`, Ruby, Bundler, and the
53-
repository dependencies:
57+
Install the exact Python version from `.python-version` and the locked
58+
development dependencies:
5459

5560
```bash
5661
python -m venv .venv
5762
. .venv/bin/activate
5863
python -m pip install -r requirements-dev.lock.txt
59-
bundle install
6064
```
6165

62-
## Required validation
66+
After changing catalog sources, regenerate the public export:
67+
68+
```bash
69+
python tools/export_catalog.py
70+
```
6371

64-
Run the same checks as CI before requesting review:
72+
Run the same deterministic checks as CI:
6573

6674
```bash
6775
python -m pytest
6876
python tools/validate_catalog.py
69-
bundle exec jekyll build
70-
bundle exec ruby tests/render_security_test.rb
77+
python tools/export_catalog.py --check
7178
```
7279

73-
Maintainers can run the networked link audit from GitHub Actions with the
74-
scheduled **Catalog link audit** workflow. For a deliberate local audit of
75-
every catalog entry, including same-origin URLs:
80+
Maintainers can run the networked link audit through GitHub Actions. For a
81+
deliberate local audit of every catalog entry:
7682

7783
```bash
7884
python tools/check_links.py --mode all --output reports/link-check.json
7985
```
8086

81-
Network link fetching is intentionally excluded from pull-request CI. A pull
82-
request can contain untrusted URLs, and status checks must remain deterministic.
83-
Any review-needed link result fails the scheduled audit so a maintainer must
84-
inspect it; it does not by itself justify removing the resource.
87+
Network fetching is excluded from pull-request CI. Any review-needed result
88+
fails the scheduled audit for maintainer inspection, but does not by itself
89+
justify removing a resource.
8590

8691
## Pull request checklist
8792

88-
- Keep catalog data and bilingual output consistent.
89-
- Include evidence for maintenance, license, safety, and adoption claims.
93+
- Keep source data and the generated `catalog.json` consistent.
94+
- Preserve English and Chinese meaning.
95+
- Include evidence for maintenance, ownership, access, and safety claims.
9096
- Do not call a project production-ready without current evidence.
91-
- Do not commit secrets, API keys, analytics IDs, generated reports, or local
92-
build output.
93-
- Submit only material you have the right to submit and retain any required
94-
third-party notice.
95-
- Explain user-visible changes and list the commands you ran.
96-
97-
## Review and merge
98-
99-
Maintainers may request edits, reclassify an entry, or decline resources that
100-
do not meet the curation policy. Passing automated checks does not replace
101-
editorial review. After merge, maintainers verify the GitHub Pages deployment
102-
and the production domain.
97+
- Do not commit secrets, generated reports, caches, or local environments.
98+
- Explain consumer-visible changes and list the validation results.
99+
100+
Passing automation does not replace editorial review. After merge, a website
101+
consumer must deliberately update its pinned catalog commit before the new data
102+
appears on flypython.com.

Gemfile

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)