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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ on:
push:
branches: [main]
pull_request:
merge_group:
types: [checks_requested]
permissions:
contents: read
jobs:
verify:
uses: FreeTWAI-AI/.github/.github/workflows/verify-template.yml@fb74d43e623f05c849664da6f2f1a630de25a898
uses: FreeTWAI/.github/.github/workflows/verify-template.yml@fb74d43e623f05c849664da6f2f1a630de25a898
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

### 接手與交付

1. 讀[目前 Issues](https://github.com/FreeTWAI-AI/FreeTWAI-AI.github.io/issues)與[已開 PR](https://github.com/FreeTWAI-AI/FreeTWAI-AI.github.io/pulls),確認範圍、完成條件、既有認領與相依工作。
1. 讀[目前 Issues](https://github.com/FreeTWAI/FreeTWAI.github.io/issues)與[已開 PR](https://github.com/FreeTWAI/FreeTWAI.github.io/pulls),確認範圍、完成條件、既有認領與相依工作。
2. 一般社群貢獻先留言提出認領範圍,讓維護者確認;若當前對話已獲明確派工,沿用授權直接做,不再發明確認關卡。不要自行發送訊息或建立 Issue,除非任務已授權。
3. 使用自己的 fork/工作分支或已授權分支。PR 目標為 `FreeTWAI-AI/FreeTWAI-AI.github.io` 的目前預設分支 `main`;不自動 force-push、合併、發版或擴大外部操作。
3. 使用自己的 fork/工作分支或已授權分支。PR 目標為 `FreeTWAI/FreeTWAI.github.io` 的目前預設分支 `main`;不自動 force-push、合併、發版或擴大外部操作。
4. PR 附原 Issue、前後行為、檔案範圍、實跑命令/結果與未驗證部分;交接列 commit、下一步及真正卡點。保留真實 GitHub 作者、review 與 merged SHA,不把未驗證 slug、點讚或使用 AI 轉成 XP/報酬/職務證明。

### 驗證
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

自由工坊公開原始碼導覽頁的產生器。 已有受限公開 repo 目錄與靜態 HTML 產生器;目前的目錄資料是導覽清單。

先看[本倉 Issues](https://github.com/FreeTWAI-AI/FreeTWAI-AI.github.io/issues)與[現有 PR](https://github.com/FreeTWAI-AI/FreeTWAI-AI.github.io/pulls)。提出問題、這一輪範圍、完成條件與可投入時間,在 Issue 認領並協調重疊工作;維護者已直接派工時不必重複等待,將約定連回交接即可。使用自己的 fork/分支,PR 送到 **FreeTWAI-AI/FreeTWAI-AI.github.io:main**。
先看[本倉 Issues](https://github.com/FreeTWAI/FreeTWAI.github.io/issues)與[現有 PR](https://github.com/FreeTWAI/FreeTWAI.github.io/pulls)。提出問題、這一輪範圍、完成條件與可投入時間,在 Issue 認領並協調重疊工作;維護者已直接派工時不必重複等待,將約定連回交接即可。使用自己的 fork/分支,PR 送到 **FreeTWAI/FreeTWAI.github.io:main**。

交給 Agent 前先讓它讀 [AGENTS.md](AGENTS.md)。PR 寫明變更用途、使用者可見結果、驗證命令、限制與原 Issue;附上可公開的合成案例或重現方式。Issue/PR 是程式協作的記錄,平台名片與公會身分不取代 repo 維護者的審查。

Expand Down Expand Up @@ -44,5 +44,5 @@ npm run build
必須另外確認該次部署成功,不能把建置通過當成已發布。

組合失敗拒絕與後續正常變更的驗收記錄見
[中央 PR #129](https://github.com/FreeTWAI-AI/freedom-platform/pull/129)。
[中央 PR #129](https://github.com/FreeTWAI/freedom-platform/pull/129)。
這項設定適用本目錄倉,不代表其他倉的 merge queue 或整體治理已完成。
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

本 repo 的維護者負責「自由工坊公開原始碼導覽頁的產生器。」這個模組;公會職稱與自填 GitHub slug 不授予寫入權。

程式/內容入口:[data/directory.json](data/directory.json)、[src/index.mjs](src/index.mjs)、[scripts/build.mjs](scripts/build.mjs)、[test/](test/)。協作先讀 [CONTRIBUTING.md](CONTRIBUTING.md),讓 Agent 讀 [AGENTS.md](AGENTS.md);從[本倉 Issues](https://github.com/FreeTWAI-AI/FreeTWAI-AI.github.io/issues)認領、[查看既有 PR](https://github.com/FreeTWAI-AI/FreeTWAI-AI.github.io/pulls)避免重工。
程式/內容入口:[data/directory.json](data/directory.json)、[src/index.mjs](src/index.mjs)、[scripts/build.mjs](scripts/build.mjs)、[test/](test/)。協作先讀 [CONTRIBUTING.md](CONTRIBUTING.md),讓 Agent 讀 [AGENTS.md](AGENTS.md);從[本倉 Issues](https://github.com/FreeTWAI/FreeTWAI.github.io/issues)認領、[查看既有 PR](https://github.com/FreeTWAI/FreeTWAI.github.io/pulls)避免重工。

只列可公開的 GitHub 來源與真實狀態;中央平台才保存會員與作品 import 事實。不要在這裡接收 session、token 或私人商品資料。 跨 repo 的協定由[中央平台](https://github.com/FreeTWAI-AI/freedom-platform)維護。
只列可公開的 GitHub 來源與真實狀態;中央平台才保存會員與作品 import 事實。不要在這裡接收 session、token 或私人商品資料。 跨 repo 的協定由[中央平台](https://github.com/FreeTWAI/freedom-platform)維護。
<!-- freedom-repository-guide:end -->

Source for a simple directory of the nine Freedom repositories, plus the privacy policy of the 自由工坊 Discord bot (小妹). Pushes to `main` build `dist/` and publish it to the organization GitHub Pages site (https://freetwai-ai.github.io/) through `.github/workflows/pages.yml`; the privacy policy is served at https://freetwai-ai.github.io/privacy/discord-bot/.
Source for a simple directory of the nine Freedom repositories, plus the privacy policy of the 自由工坊 Discord bot (小妹). Pushes to `main` build `dist/` and publish it to the organization GitHub Pages site (https://freetwai.github.io/) through `.github/workflows/pages.yml`; the privacy policy is served at https://freetwai.github.io/privacy/discord-bot/.

With Node 24:

Expand Down
4 changes: 2 additions & 2 deletions data/directory.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schema_version": "freedom.source-directory/v1",
"organization": "FreeTWAI-AI",
"organization": "FreeTWAI",
"projects": [
{ "repository": "freedom-platform", "name": "共同平台", "description": "會員定位、公會、供貨、零售、開源作品與行銷的共同 API、資料庫及會員工作台。", "scope": "可運行的內部預覽;正式產品仍在建置。" },
{ "repository": "freedom-agent-kit", "name": "Agent 協作工具", "description": "使用固定版本協定與平台互動的 CLI/Agent 接線起點。", "scope": "原始碼與協定用戶端;授權由平台決定。" },
Expand All @@ -10,6 +10,6 @@
{ "repository": "freedom-project-template", "name": "新專案模板", "description": "Node 24 的可運行起點,附測試、資料邊界與新專案身分設定指引。", "scope": "每個新專案必須填寫自己的真實 GitHub 身分。" },
{ "repository": "freedom-project-page", "name": "專案介紹頁產生器", "description": "由公開 manifest 產生固定 HTML,保留来源與限制。", "scope": "只產生 artifact;不推定正式狀態或自動發布。" },
{ "repository": ".github", "name": "組織協作規範", "description": "組織介紹、協作表單、共用政策與工作流程起點。", "scope": "組織支援倉;不承載會員與交易資料。" },
{ "repository": "FreeTWAI-AI.github.io", "name": "專案目錄", "description": "這份九個來源倉的導覽。", "scope": "以 GitHub Pages 發布這份導覽與 Discord 機器人隱私權政策;不代表各專案已上線。" }
{ "repository": "FreeTWAI.github.io", "name": "專案目錄", "description": "這份九個來源倉的導覽。", "scope": "以 GitHub Pages 發布這份導覽與 Discord 機器人隱私權政策;不代表各專案已上線。" }
]
}
4 changes: 2 additions & 2 deletions data/privacy-discord-bot.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
]}
]},
{ "h": "公開的 GitHub Issue", "blocks": [
{ "p": "你請小妹回報問題時,她會先貼出草稿,只有在你或管理員明確確認後才送出。送出的 Issue 是公開的,會建立在 FreeTWAI-AI 的公開 repo 之一(freedom-platform、freedom-skill-registry、freedom-storefront、freedom-supplier-client),內容包括:你的 Discord 顯示名稱(不含使用者 ID)、Discord 討論串與訊息連結、問題描述,以及截圖的文字說明。" },
{ "p": "你請小妹回報問題時,她會先貼出草稿,只有在你或管理員明確確認後才送出。送出的 Issue 是公開的,會建立在 FreeTWAI 的公開 repo 之一(freedom-platform、freedom-skill-registry、freedom-storefront、freedom-supplier-client),內容包括:你的 Discord 顯示名稱(不含使用者 ID)、Discord 討論串與訊息連結、問題描述,以及截圖的文字說明。" },
{ "p": "截圖(來自觸發回報的訊息、它回覆的訊息,或你本人最近 30 分鐘內在該串的訊息,最多 4 張)會先移除中繼資料,再上傳到公開 repo teddashh/freeworkshop-issue-assets。這些公開內容不適用 30 天刪除規則。你提出要求時,我們會刪除該 Issue 並移除檔案,但副本仍可能留在 git 歷史、分支(fork)、快取或第三方封存中。未送出的草稿 24 小時後失效,30 天後刪除。" }
]},
{ "h": "你的選擇", "blocks": [
Expand Down Expand Up @@ -115,7 +115,7 @@
]}
]},
{ "h": "Public GitHub issues", "blocks": [
{ "p": "When you ask the bot to report a problem, it first posts a draft, and files it only after you or an administrator explicitly confirms. A filed issue is public, in one of the FreeTWAI-AI public repositories (freedom-platform, freedom-skill-registry, freedom-storefront, freedom-supplier-client). It includes your Discord display name (not your user ID), links to the Discord thread and message, the problem description, and a text description of any screenshots." },
{ "p": "When you ask the bot to report a problem, it first posts a draft, and files it only after you or an administrator explicitly confirms. A filed issue is public, in one of the FreeTWAI public repositories (freedom-platform, freedom-skill-registry, freedom-storefront, freedom-supplier-client). It includes your Discord display name (not your user ID), links to the Discord thread and message, the problem description, and a text description of any screenshots." },
{ "p": "Screenshots (from the triggering message, the message it replies to, or your own messages in that thread from the last 30 minutes; up to 4) have their metadata stripped and are uploaded to the public repository teddashh/freeworkshop-issue-assets. This public content is not subject to the 30-day deletion. On request we will delete the issue and remove the files, but copies may remain in git history, forks, caches or third-party archives. Unconfirmed drafts expire after 24 hours and are deleted after 30 days." }
]},
{ "h": "Your choices", "blocks": [
Expand Down
20 changes: 10 additions & 10 deletions freedom.project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Organize public project metadata and repository links"
],
"limitations": [
"Published only as the organization GitHub Pages site (https://freetwai-ai.github.io/); no custom production domain is configured",
"Published only as the organization GitHub Pages site (https://freetwai.github.io/); no custom production domain is configured",
"Quality and release fields declare intended policy; they do not attest an enforced ruleset or a signed release",
"NOASSERTION means licensing remains undecided; this metadata grants no additional reuse rights",
"GitHub Pages (via .github/workflows/pages.yml on main) serves the source directory and the Discord bot privacy policy at /privacy/discord-bot/; linked projects are not published or certified by it"
Expand All @@ -28,9 +28,9 @@
"accountable_team": null,
"external_owner": {
"type": "Organization",
"account_id": "331546855",
"login": "FreeTWAI-AI",
"html_url": "https://github.com/FreeTWAI-AI"
"account_id": "342048686",
"login": "FreeTWAI",
"html_url": "https://github.com/FreeTWAI"
},
"accountable_party_ref": "user:teddashh",
"module_stewardship_ref": null,
Expand All @@ -47,8 +47,8 @@
"security_contact": "https://github.com/teddashh"
},
"repository": {
"full_name": "FreeTWAI-AI/FreeTWAI-AI.github.io",
"html_url": "https://github.com/FreeTWAI-AI/FreeTWAI-AI.github.io",
"full_name": "FreeTWAI/FreeTWAI.github.io",
"html_url": "https://github.com/FreeTWAI/FreeTWAI.github.io",
"repository_id": "1378081698",
"default_branch": "main",
"visibility": "public",
Expand All @@ -62,7 +62,7 @@
"requested_trust_label": "incubating",
"source": "generated",
"canonical_platform_url": "https://staging.freetwai.com/",
"github_pages_url": "https://freetwai-ai.github.io/",
"github_pages_url": "https://freetwai.github.io/",
"exception_reason": null,
"required_sections": [
"identity_and_status",
Expand Down Expand Up @@ -168,9 +168,9 @@
]
},
"links": {
"documentation": "https://github.com/FreeTWAI-AI/FreeTWAI-AI.github.io/blob/main/README.md",
"documentation": "https://github.com/FreeTWAI/FreeTWAI.github.io/blob/main/README.md",
"demo": null,
"support": "https://github.com/FreeTWAI-AI/FreeTWAI-AI.github.io/issues",
"issues": "https://github.com/FreeTWAI-AI/FreeTWAI-AI.github.io/issues"
"support": "https://github.com/FreeTWAI/FreeTWAI.github.io/issues",
"issues": "https://github.com/FreeTWAI/FreeTWAI.github.io/issues"
}
}
4 changes: 2 additions & 2 deletions scripts/verify-contracts.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {resolve} from 'node:path';
const root=process.cwd(),vendor=resolve(root,'vendor/freedom-platform');
const lock=JSON.parse(await readFile(resolve(root,'contracts.lock.json'),'utf8'));
const hash=data=>createHash('sha256').update(data).digest('hex');
if(lock.source_repository!=='FreeTWAI-AI/freedom-platform'||!/^[a-f0-9]{40}$/.test(lock.source_commit)||lock.bundle_path!=='contracts/preview/v1')throw Error('Invalid canonical contract source');
if(!['FreeTWAI-AI/freedom-platform','FreeTWAI/freedom-platform'].includes(lock.source_repository)||!/^[a-f0-9]{40}$/.test(lock.source_commit)||lock.bundle_path!=='contracts/preview/v1')throw Error('Invalid canonical contract source');
const manifestBytes=await readFile(resolve(vendor,'bundle.json'));
if(hash(manifestBytes)!==lock.bundle_sha256)throw Error('Contract bundle digest differs from lock');
const bundle=JSON.parse(manifestBytes);if(bundle.protocol!==lock.protocol||bundle.protocol_sha256!==lock.protocol_sha256)throw Error('Protocol identity differs from lock');
Expand All @@ -18,6 +18,6 @@ for(const file of expected){
const path=resolve(vendor,file);if(!(await lstat(path)).isFile())throw Error('Artifact must be a regular file');
const local=await readFile(path);const declared=file==='bundle.json'?{sha256:lock.bundle_sha256}:bundle.files[file];
if(hash(local)!==declared.sha256||(declared.bytes!==undefined&&local.byteLength!==declared.bytes))throw Error(`Modified canonical artifact ${file}`);
if(remote){const url=`https://raw.githubusercontent.com/${lock.source_repository}/${lock.source_commit}/${lock.bundle_path}/${file}`;const response=await fetch(url,{redirect:'error',signal:AbortSignal.timeout(20000)});if(!response.ok)throw Error(`Cannot verify pinned artifact ${file}: ${response.status}`);const bytes=new Uint8Array(await response.arrayBuffer());if(bytes.byteLength>2_000_000||hash(bytes)!==declared.sha256)throw Error(`Pinned upstream differs: ${file}`);}
if(remote){const url=`https://raw.githubusercontent.com/FreeTWAI/freedom-platform/${lock.source_commit}/${lock.bundle_path}/${file}`;const response=await fetch(url,{redirect:'error',signal:AbortSignal.timeout(20000)});if(!response.ok)throw Error(`Cannot verify pinned artifact ${file}: ${response.status}`);const bytes=new Uint8Array(await response.arrayBuffer());if(bytes.byteLength>2_000_000||hash(bytes)!==declared.sha256)throw Error(`Pinned upstream differs: ${file}`);}
}
console.log(`Contract ${lock.protocol} at ${lock.source_commit.slice(0,12)}: ${expected.size} artifacts verified${remote?' against pinned GitHub source':''}.`);
2 changes: 1 addition & 1 deletion src/index.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const escapeHtml = (value) => String(value).replace(/[&<>"']/g, (character) => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#39;' })[character]);

export function validateDirectory(input) {
if (input?.schema_version !== 'freedom.source-directory/v1' || input.organization !== 'FreeTWAI-AI' || !Array.isArray(input.projects) || input.projects.length > 100) throw new TypeError('Expected the FreeTWAI-AI public source directory');
if (input?.schema_version !== 'freedom.source-directory/v1' || input.organization !== 'FreeTWAI' || !Array.isArray(input.projects) || input.projects.length > 100) throw new TypeError('Expected the FreeTWAI public source directory');
const seen = new Set();
for (const project of input.projects) {
if (!project || !/^(?:\.github|[A-Za-z0-9][A-Za-z0-9._-]{0,99})$/.test(project.repository ?? '') || project.repository.includes('..')) throw new TypeError('Invalid repository name');
Expand Down
4 changes: 2 additions & 2 deletions test/directory.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ test('the directory links all nine source repositories and claims no verified re
const directory = JSON.parse(await readFile(new URL('../data/directory.json', import.meta.url), 'utf8'));
const html = renderDirectory(directory);
assert.equal(directory.projects.length, 9);
for (const project of directory.projects) assert.ok(html.includes(`https://github.com/FreeTWAI-AI/${project.repository}`));
for (const project of directory.projects) assert.ok(html.includes(`https://github.com/FreeTWAI/${project.repository}`));
assert.match(html, /不代表各項產品已正式上線/);
assert.doesNotMatch(html, /<script|https:\/\/staging\./);
});
test('directory text is escaped and repository names cannot inject URLs or paths', () => {
const project = { repository: 'example', name: '<script>x</script>', description: 'Example', scope: 'Source only' };
const input = { schema_version: 'freedom.source-directory/v1', organization: 'FreeTWAI-AI', projects: [project] };
const input = { schema_version: 'freedom.source-directory/v1', organization: 'FreeTWAI', projects: [project] };
assert.match(renderDirectory(input), /&lt;script&gt;/);
assert.throws(() => validateDirectory({ ...input, projects: [{ ...project, repository: '../../private' }] }), /Invalid repository/);
assert.throws(() => validateDirectory({ ...input, projects: [project, { ...project, repository: 'EXAMPLE' }] }), /Duplicate/);
Expand Down
Loading