Skip to content

Commit aeabc31

Browse files
committed
Load html previews from psyflow-web manifest
1 parent 076df59 commit aeabc31

68 files changed

Lines changed: 4864 additions & 1537 deletions

Some content is hidden

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

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Public, statically deployed website that lists TaskBeacon task repositories as a
44

55
- Gallery: list and card views, maturity + paradigm filters, last updated, repo/download links
66
- Task detail pages: README rendering, quick start, metadata, local access panel, optional web preview panel
7-
- Companion detection: baseline tasks automatically pick up matching HTML repos when they share the same `slug` and the companion declares `variant: html`
7+
- Companion detection: baseline tasks automatically pick up matching HTML repos at runtime from the shared `psyflow-web` manifest when they share the same `slug` and the companion declares `variant: html`
88
- Deployment: static export to GitHub Pages via GitHub Actions
99

1010
## Tech
@@ -55,7 +55,7 @@ It:
5555
2. Excludes non-task repos via `DENYLIST`.
5656
3. Fetches README content, repo root contents, and optional metadata files.
5757
4. Builds a normalized task record for each task repo.
58-
5. Merges matching HTML companions into the main task card as `web_variant`.
58+
5. Keeps the canonical task index focused on task repos and excludes duplicate HTML companions when a baseline task with the same `slug` exists.
5959

6060
Supported metadata files, in priority order:
6161

@@ -84,6 +84,14 @@ If both exist, the website keeps the main task card and adds:
8484

8585
for the matched HTML companion.
8686

87+
The companion buttons are attached at runtime by fetching:
88+
89+
```text
90+
/psyflow-web/task-manifest.json
91+
```
92+
93+
This keeps `taskbeacon.github.io` independent from HTML companion rebuilds. Only the shared `psyflow-web` runner needs to refresh when new `Hxxxxxx-*` repos appear.
94+
8795
By default, HTML companions run through the shared `psyflow-web` GitHub Pages runner:
8896

8997
```text

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
## 2026-03-11
4+
5+
- Switched HTML companion discovery from build-time index merging to runtime attachment via the shared `psyflow-web` manifest.
6+
- Added a shared client-side companion loader that fetches `/psyflow-web/task-manifest.json` and merges matching HTML previews onto canonical TaskBeacon tasks by `slug` and `T/H` task id pairing.
7+
- Updated the gallery, featured carousel, homepage preview counters, footer summary, and task detail pages to use runtime companion data without changing the visible card layout.
8+
- Simplified the indexer so `tasks_index.json` now stays focused on canonical task records, while HTML preview metadata lives in the `psyflow-web` manifest.

public/readmes/ANT.md

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

public/readmes/H000002-bart.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# H000002 BART
2+
3+
HTML/browser preview of the Balloon Analogue Risk Task built with `psyflow-web`.
4+
The within-trial pump/cash loop, deterministic explosion sampler, risk-condition semantics, instruction text, and feedback logic are aligned to the local `T000002-bart` task; only the block and trial count are shortened for preview use.
5+
6+
## Layout
7+
8+
- `main.ts`: task-level orchestration
9+
- `config/config.yaml`: declarative task config
10+
- `src/run_trial.ts`: trial-level logic
11+
- `src/utils.ts`: explosion sampler and block summary helpers
12+
- `assets/`: task-specific balloon and audio assets
13+
14+
## Run
15+
16+
From [psyflow-web](/e:/xhmhc/TaskBeacon/psyflow-web):
17+
18+
```powershell
19+
npm install
20+
npm run dev
21+
```
22+
23+
Then open:
24+
25+
```text
26+
http://127.0.0.1:4173/?task=H000002-bart
27+
```

public/readmes/H000012-sst.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# H000012 SST
2+
3+
HTML/browser preview of the Stop-Signal Task built with `psyflow-web`.
4+
The within-trial procedure, go/stop condition semantics, instruction text, and adaptive SSD controller are aligned to the local `T000012-sst` task; only the block and trial count are shortened for preview use.
5+
6+
## Layout
7+
8+
- `main.ts`: task-level orchestration
9+
- `config/config.yaml`: declarative task config
10+
- `src/run_trial.ts`: trial-level logic
11+
- `src/controller.ts`: adaptive SSD controller
12+
- `src/utils.ts`: constrained condition generator and block summary helpers
13+
14+
## Run
15+
16+
From [psyflow-web](/e:/xhmhc/TaskBeacon/psyflow-web):
17+
18+
```powershell
19+
npm install
20+
npm run dev
21+
```
22+
23+
Then open:
24+
25+
```text
26+
http://127.0.0.1:4173/?task=H000012-sst
27+
```

public/readmes/T000001-ax-cpt.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# AX-CPT Task
22

3-
![Maturity: smoke_tested](https://img.shields.io/badge/Maturity-smoke_tested-d97706?style=for-the-badge&labelColor=c2410c)
4-
3+
![Maturity: smoke_tested](https://img.shields.io/badge/Maturity-smoke_tested-d97706?style=flat-square&labelColor=111827)
54
| Field | Value |
65
|---|---|
76
| Name | AX-CPT Task |
8-
| Version | main (1.0) |
7+
| Version | main (1.1.0) |
98
| URL / Repository | https://github.com/TaskBeacon/T000001-ax-cpt |
109
| Short Description | A task measuring cognitive control, context processing, and goal maintenance. |
1110
| Created By | Zhipeng Cao (zhipeng30@foxmail.com) |
12-
| Date Updated | 2025/07/25 |
13-
| PsyFlow Version |0.1.0|
11+
| Date Updated | 2026/02/16 |
12+
| PsyFlow Version | 0.1.8 |
1413
| PsychoPy Version |2025.1.1 |
1514
| Modality |Behavior/EEG |
1615
| Language | Chinese |
@@ -20,6 +19,9 @@
2019
This task is an AX-Continuous Performance Test (AX-CPT) designed to assess cognitive control and context processing. Participants are presented with a series of letter pairs (cue followed by probe). They must make a specific target response only when the cue is an 'A' and the probe is an 'X' (AX trials). For all other combinations (AY, BX, BY), a different response (or no response) is required.
2120

2221
## 2. Task Flow
22+
23+
![Task flow](./task_flow.png)
24+
2325
### Block-Level Flow
2426
| Step | Description |
2527
|---|---|
@@ -38,6 +40,13 @@ This task is an AX-Continuous Performance Test (AX-CPT) designed to assess cogni
3840
| 4. Feedback | Feedback (`Correct`, `Incorrect`, or `Too Slow`) is displayed. |
3941
| 5. Inter-Trial Interval (ITI) | A blank screen is shown before the next trial. |
4042

43+
### Runtime Context Phases
44+
| Phase Label | Meaning |
45+
|---|---|
46+
| `context_cue` | context cue stage in `src/run_trial.py` responder context. |
47+
| `delay_fixation` | delay fixation stage in `src/run_trial.py` responder context. |
48+
| `probe_response` | probe response stage in `src/run_trial.py` responder context. |
49+
4150
## 3. Configuration Summary
4251
### a. Subject Info
4352
| Field | Meaning |
@@ -66,9 +75,9 @@ This task is an AX-Continuous Performance Test (AX-CPT) designed to assess cogni
6675
| cue_B | text | The cue letter 'B'. |
6776
| probe_X | text | The probe letter 'X'. |
6877
| probe_Y | text | The probe letter 'Y'. |
69-
| correct_feedback | text | "正确" (Correct) in white. |
70-
| incorrect_feedback | text | "错误" (Incorrect) in white. |
71-
| no_response_feedback | text | "未反� (No response) in white. |
78+
| correct_feedback | text | "正确" (Correct) in white. |
79+
| incorrect_feedback | text | "错误" (Incorrect) in white. |
80+
| no_response_feedback | text | "未反? (No response) in white. |
7281
| instruction_text | textbox | Instructions explaining the task. |
7382
| instruction_text_voice | voice | Voice instructions for the task. |
7483
| block_break | text | Feedback shown between blocks. |
@@ -82,7 +91,7 @@ This task is an AX-Continuous Performance Test (AX-CPT) designed to assess cogni
8291
| isi | 0.5 | isi_duration |
8392
| probe | 1.0 (max response time) | probe_duration |
8493
| feedback | 0.5 | feedback_duration |
85-
| iti | random 0.8�.2 | iti_duration |
94+
| iti | random 0.8?.2 | iti_duration |
8695

8796
### e. Triggers
8897
| Event | Code |
@@ -104,9 +113,9 @@ This task is an AX-Continuous Performance Test (AX-CPT) designed to assess cogni
104113
| feedback_no_response | 53 |
105114
| feedback_onset | 60 |
106115

107-
## 4. Methods
116+
## 4. Methods (for academic publication)
108117
Participants perform an AX-CPT task, a continuous performance paradigm used to measure cognitive control and context processing. Each trial consists of a cue letter (A or B) followed by a probe letter (X or Y). Participants are instructed to press the 'f' key if the cue is 'A' and the probe is 'X' (AX trials). For all other cue-probe combinations (AY, BX, BY), they are instructed to press the 'j' key.
109118

110119
The task begins with a fixation cross, displayed for 500ms. The cue letter is then presented for 500ms, followed by a brief inter-stimulus interval (ISI) fixation of 500ms, and then the probe letter for up to 1000ms or until a response is made. Feedback (correct, incorrect, or no response) is provided for 500ms, followed by a randomized inter-trial interval between 800ms and 1200ms.
111120

112-
The task is structured into 4 blocks of 40 trials each (total 160 trials). Trial types (AX, AY, BX, BY) are presented in a randomized order within each block, with a higher proportion of AX trials to establish a strong context. This design allows for the examination of proactive and reactive cognitive control strategies.
121+
The task is structured into 4 blocks of 40 trials each (total 160 trials). Trial types (AX, AY, BX, BY) are presented in a weighted randomized order within each block (`AX=40%`, `AY=10%`, `BX=10%`, `BY=40%`) to preserve strong context expectancy while retaining critical low-frequency AY/BX control trials. This design allows for the examination of proactive and reactive cognitive control strategies.

0 commit comments

Comments
 (0)