Add ChatGPT handover snapshot script and project context

This commit is contained in:
rob
2026-11-04 13:18:42 +00:00
parent 1ccba36a4e
commit 03e15dd531
9 changed files with 265 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
/snapshots/
/.worktrees/
+39
View File
@@ -0,0 +1,39 @@
# Repository operating instructions
Roborto Context System: 1.0
This repository uses Roborto Workflow 2.0 around the six-file Context System 1.0. The project owner is **Captain**. Use a restrained bridge/engineering voice while keeping technical reports precise. Captain retains product, merge, and release authority unless explicitly delegated.
## Read before work
Read this file and any applicable nested `AGENTS.md`, then `docs/PROJECT_OVERVIEW.md`, `docs/CURRENT_STATE.md`, `docs/DECISIONS.md`, `docs/TASKS.md`, and `docs/HANDOFF.md`. Read relevant source, configuration, tests, and project-specific development, styling, Git, and deployment guidance before acting. For UI work, inspect existing SCSS/components and any approved design references before proposing visual changes.
Current repository code/configuration and Git state are authoritative for current facts; maintained documentation follows, then accepted task requirements, then the replaceable handoff and older conversations. Report material conflicts. The Captain's current explicit instruction controls requested changes. Preserve existing behavior unless that instruction or an accepted task changes it. Do not expose local secrets or data in context files.
## Before application changes
Verify and report the current worktree path, branch, Git status, existing uncommitted/untracked changes, active accepted numbered task, relevant decisions, and dependencies. Do not overwrite unrelated changes. Read-only diagnosis, review, planning, and design can happen in the current worktree. Context administration is documentation-only by default and does not trigger branch switching or task-worktree creation.
For implementation, use one accepted numbered task per isolated task branch/worktree by default. Concurrent tasks use separate worktrees; do not mix unrelated task changes or edit a manual-test snapshot. Derive the task branch from the repository-approved integration branch. This repository has **no approved branch naming, worktree path, merge strategy, or release branch convention yet**; proposed defaults are in `docs/DECISIONS.md`. Resolve those conventions with Captain before first use rather than treating proposals as established rules. Never switch a branch used by another console or check one branch out in two worktrees.
Do not commit, push, merge, rebase, reset, deploy, or perform destructive operations without repository workflow authority or Captain's explicit authorization. Leave merge and release authority with Captain unless explicitly delegated. The repository has no discovered manual-test/testtask adapter; if one is later added, use it for test evidence and keep implementation in the task worktree.
## Task lifecycle and handoff
`docs/TASKS.md` records accepted scoped implementation work, not a speculative backlog. Use **Accepted**, **In progress**, **Implementation-ready / awaiting Captain validation**, and **Complete**. A task reaches Complete only after its acceptance criteria and required Captain/manual review are satisfied; automated checks alone do not grant acceptance. Record blockers explicitly.
Brief a substantial task before implementation when useful: objective, scope, non-goals, acceptance criteria, dependencies, risks, unresolved decisions, specialist skill, and validation plan. For meaningful implementation, keep code, tests, and context together in the task worktree; run repository-defined and task-specific checks; review the diff against the approved base; update relevant context; and prepare a concise handoff. Do not begin unrelated task work from a handoff.
The available frontend package scripts are `npm run lint` and `npm run build` from `react/`. No API test command is documented in this repository. Define task-specific validation from actual changed surfaces; report checks actually run, failures, and checks unavailable. Read `react/src/styles/` and relevant component SCSS before UI work.
Use the smallest useful specialist sequence: Roborto New Project for a new app; Frontend UI Design before unsettled UI; Webapp Feature for a scoped feature; Webapp Debug for an unknown defect; Frontend Visual QA for implemented UI; Safe Refactor for behavior-preserving structure work; Code Review for a task diff; Production Readiness Review and Deployment Check for release work; Project Commercial Management for commercial scope; Roborto Contributor for delegated contributor work. Recommend skills without claiming they ran.
## Context ownership
- `docs/PROJECT_OVERVIEW.md`: stable repository-supported facts.
- `docs/CURRENT_STATE.md`: verified current state and known issues.
- `docs/DECISIONS.md`: durable accepted choices and pending decisions, clearly distinguished.
- `docs/TASKS.md`: accepted numbered task scope and lifecycle.
- `docs/HANDOFF.md`: replaceable, supplementary transfer snapshot.
Update the owning file when work changes its facts. Never invent historical decisions, accepted tasks, validation results, commercial facts, or deployment state.
+22
View File
@@ -0,0 +1,22 @@
# Foldershare current state
- Updated: 2026-11-04
- Inspected worktree: `/home/rob/projects/foldershare`
- Branch and HEAD at inspection: `main` at `1ccba36`
## Verified repository state
Before this reconciliation, the tracked tree contained the Flask API and React/Vite frontend described in `PROJECT_OVERVIEW.md`, with no tracked tests, CI workflow, or deployment instructions. Git had one worktree on `main` and no uncommitted or untracked changes. These are repository observations, not proof of working application behavior or a deployed service.
This reconciliation adds Context System 1.0 and Workflow 2.0 documentation only. No application code, configuration, or runtime behavior was changed.
## Current task and validation state
- TASK-001 is implementation-ready in `.worktrees/TASK-001` on `task/TASK-001-handover-zip`, awaiting Captain validation.
- No application tests, lint, build, or runtime checks were run as part of this documentation reconciliation.
- Captain approved TASK-001's branch/worktree convention. Future-task, merge, and release conventions remain pending in `DECISIONS.md`.
- No manual-test/testtask adapter was found in tracked repository files.
## Known limitations of this record
Application behavior, deployment, and local database state have not been verified. Record confirmed issues here when supported by evidence; do not turn unverified concerns into accepted tasks.
+33
View File
@@ -0,0 +1,33 @@
# Foldershare decisions
Record durable accepted project choices here. Pending proposals are explicitly non-authoritative until Captain accepts them. No historical project rationale was found or inferred during the 2026-11-04 reconciliation.
## WF-001: Context and task authority
- Status: Accepted by Captain's 2026-11-04 reconciliation instruction
- Date: 2026-11-04
### Decision
Use Roborto Context System 1.0 as the six-file documentation format and Workflow 2.0 for operating rules. Captain is project owner and retains merge/release authority unless explicitly delegated. Current repository evidence is authoritative for current facts. Preserve existing behavior outside accepted scope. Use one accepted numbered implementation task per isolated branch/worktree by default, separate worktrees for concurrent tasks, and a Captain validation gate before marking work Complete where review is required.
### Consequences
Documentation administration does not start feature work. Application changes require preflight of worktree, branch, status, task, decisions, and dependencies. Task validation and diff review lead to an implementation-ready handoff; they do not imply Captain acceptance.
## WF-002: Task branch and worktree convention
- Status: Accepted by Captain for TASK-001 on 2026-11-04
- Date: 2026-11-04
Use `main` as TASK-001's base, `task/TASK-001-handover-zip` as its branch, and `.worktrees/TASK-001` as its isolated worktree. This approval covers the task's implementation location. It does not authorize a merge, release, or deployment.
## Pending: Merge and release conventions
No merge or release convention is documented in the pre-existing repository. The following are **proposals for Captain approval**, not current rules:
1. Future tasks use `main` as integration/base, `task/TASK-###-short-name` branches, and `.worktrees/TASK-###` worktrees. TASK-001's specific branch and worktree are approved above.
2. Merge strategy: Captain reviews the task diff and performs a squash merge into the approved integration branch after acceptance.
3. Release/deployment branch: use `main` only if Captain confirms it as the release source; otherwise define a separate release branch before any release workflow.
Until approved, brief the concrete convention choice before creating later task branches/worktrees or merging. Do not infer deployment authorization from a branch choice. Record Captain's decision here and preserve any later superseded decision.
+22
View File
@@ -0,0 +1,22 @@
# Foldershare handoff
This is a replaceable, supplementary transfer snapshot. Current repository code, Git state, and maintained context documents take precedence if this file becomes stale. Refresh it rather than appending a transcript.
- Updated: 2026-11-04
- Worktree: `/home/rob/projects/foldershare/.worktrees/TASK-001`
- Branch and base commit: `task/TASK-001-handover-zip` from `main` at `1ccba36`
- Task files: context documents, root `.gitignore`, `scripts/create_snapshot.py`, and `scripts/README.md`
## Current work
TASK-001 is implementation-ready, awaiting Captain validation. The script writes handover ZIPs to the ignored `snapshots/` folder. Captain authorized a commit and merge to a `codex` branch so the script can be run there; this is not task acceptance or deployment authorization.
## Validation record
- Two sample ZIPs were created. Archive inspection found the required source and six context files, no forbidden paths or file types, and no prior ZIP in the second snapshot.
- `git check-ignore` confirmed `snapshots/` and its ZIP files are ignored.
- No frontend, API, runtime, or deployment validation was required for this repository utility.
## Decisions and next action
Captain will run the script from `codex`, inspect the generated snapshot, then accept or request changes. The task must not be marked Complete solely from automated checks. A general merge and release policy remains pending in `docs/DECISIONS.md`.
+31
View File
@@ -0,0 +1,31 @@
# Foldershare project overview
Stable facts here are based on repository source and configuration as inspected on 2026-11-04. This is not a runtime or deployment verification record.
## Product and architecture
The repository contains a folder-sharing web application. `react/` is a React 18, Vite, React Bootstrap frontend with login, file-browser, and user-management views. `api/` is a Flask API with token authentication, user and file routes, Flask-SQLAlchemy models, and Flask-Migrate migrations. The API config selects a local SQLite database. The Vite development server proxies `/api` to `http://localhost:5000`.
## Repository layout
- `api/api.py`, `api/settings.py`, `api/routes/`, `api/models/`, `api/migrations/`: backend entrypoint, configuration, routes, data models, and migrations.
- `react/src/`: frontend views, components, routing, auth context, and SCSS.
- `react/package.json`: frontend dependencies and scripts.
- `react/README.md`: upstream Vite template README; it does not define a project workflow.
## Development and validation evidence
- `react/package.json` defines `npm run dev`, `npm run build`, `npm run lint`, and `npm run preview`.
- `react/vite.config.js` defines the development API proxy.
- `api/config/requirements.txt` lists Python dependencies. No repository-defined API test command or test suite is tracked.
- No tracked CI, container, deployment, Git workflow, or manual-test/testtask documentation was found during reconciliation.
- Existing UI styling references are `react/src/styles/` and component `*.module.scss` files; no separate style guide is tracked.
Local environment files and runtime data under `api/` are ignored by Git. Their contents are not part of this overview.
## Context map
- Current state: `docs/CURRENT_STATE.md`
- Durable decisions and pending convention proposals: `docs/DECISIONS.md`
- Accepted implementation work: `docs/TASKS.md`
- Replaceable transfer snapshot: `docs/HANDOFF.md`
+30
View File
@@ -0,0 +1,30 @@
# Foldershare tasks
This file holds accepted, scoped implementation work. It is not a speculative backlog. Known current-state observations belong in `CURRENT_STATE.md`; durable decisions belong in `DECISIONS.md`.
## Active tasks
### TASK-001: Create a ChatGPT handover ZIP snapshot script
- Status: Implementation-ready / awaiting Captain validation
- Objective: Provide a repeatable local script that archives the project into a ZIP suitable for ChatGPT handover.
- Scope: Add the script under `scripts/`, write ZIPs under `snapshots/`, add `snapshots/` to a root `.gitignore`, and provide brief usage documentation. Include project source and context, including uncommitted documentation, while excluding generated dependencies, local environments, runtime data, secrets, Git metadata, and prior archives.
- Non-goals: Change application behavior, deploy, upload the ZIP, or alter repository history.
- Acceptance criteria: One documented command creates a ZIP in `snapshots/`; a root `.gitignore` ignores that folder; its contents include application source and the six context files; `node_modules`, `.venv`, `api/share`, local environment files, database/runtime files, `.git`, caches, and generated output are absent; repeated runs do not include earlier ZIPs.
- Relevant areas: `scripts/`, `snapshots/`, root `.gitignore`, `api/`, `react/`, `docs/`, and existing ignore rules.
- Dependencies and unresolved decisions: Captain selected the script and ZIP locations and approved this task's branch/worktree convention. The script includes safe untracked files, including the context files. Captain review remains before completion; merge and release conventions remain pending in `DECISIONS.md`.
- Risks: Accidental inclusion of secrets or shared files; omission of useful untracked context. The script needs an explicit exclusion list and archive-content inspection.
- Validation plan: Create a sample ZIP, list its entries, check required inclusions and forbidden paths, and run a second snapshot to verify prior ZIPs stay excluded. Review the task diff against the approved base.
- Recommended specialist skill: Webapp Feature for this scoped repository utility; Code Review if an independent security-oriented diff review is useful.
## Task record format
Create a numbered `TASK-###` only for an accepted scope. Record its objective, scope, non-goals, observable acceptance criteria, relevant files, dependencies and unresolved decisions, risks, required automated and manual validation, and specialist skill recommendation. Use these statuses:
- **Accepted**: scope approved and ready to select.
- **In progress**: implementation underway in the task worktree.
- **Implementation-ready / awaiting Captain validation**: implementation, required agent checks, diff review, context update, and handoff are ready; Captain/manual acceptance remains.
- **Complete**: acceptance criteria and required Captain/manual validation are satisfied and recorded.
- **Blocked**: work cannot proceed; state the blocking decision or dependency.
Do not mark a task Complete solely because automated checks pass. Keep each task's code, tests, and context changes on its dedicated branch; do not combine unrelated numbered tasks.
+11
View File
@@ -0,0 +1,11 @@
# ChatGPT handover snapshot
From the repository root, run:
```bash
python3 scripts/create_snapshot.py
```
The script writes a timestamped ZIP into `snapshots/`. It includes the application source, `AGENTS.md`, `docs/`, and `scripts/`, including safe untracked files. It omits Git metadata, task worktrees, dependency directories, local environment files, local databases, shared files, caches, generated builds, prior snapshots, symlinks, and common key/credential files. The root `.gitignore` ignores `snapshots/`.
Inspect the ZIP contents before uploading it if you have added new local data or sensitive file types to the project.
+75
View File
@@ -0,0 +1,75 @@
#!/usr/bin/env python3
"""Create a source-and-context ZIP for a ChatGPT project handover."""
from datetime import datetime
import os
from pathlib import Path
from zipfile import ZIP_DEFLATED, ZipFile
ROOT = Path(__file__).resolve().parent.parent
OUTPUT = ROOT / "snapshots"
ROOT_ENTRIES = ("AGENTS.md", ".gitignore", "README.md", "api", "react", "docs", "scripts")
EXCLUDED_DIRS = {
".git", ".worktrees", ".venv", "venv", "node_modules", "share",
"instance", "__pycache__", ".pytest_cache", ".mypy_cache", ".ruff_cache",
"dist", "dist-ssr", "build", "coverage", "snapshots", "logs",
}
EXCLUDED_NAMES = {".env", ".flaskenv", ".DS_Store"}
EXCLUDED_SUFFIXES = (".pyc", ".pyo", ".log", ".zip", ".db", ".sqlite", ".sqlite3", ".pem", ".key", ".p12", ".pfx")
def safe_file(path: Path) -> bool:
name = path.name.lower()
if path.is_symlink() or not path.is_file():
return False
if name.startswith(".") and name != ".gitignore":
return False
if name in EXCLUDED_NAMES or name.startswith(".env."):
return False
if name.startswith(("credentials", "id_rsa", "id_ed25519")):
return False
return not name.endswith(EXCLUDED_SUFFIXES)
def source_files():
for root_name in ROOT_ENTRIES:
entry = ROOT / root_name
if entry.is_file():
if safe_file(entry):
yield entry
continue
if not entry.is_dir() or entry.is_symlink():
continue
for directory, dirs, files in os.walk(entry, followlinks=False):
dirs[:] = sorted(
name for name in dirs
if name not in EXCLUDED_DIRS
and not name.startswith(".")
and not (Path(directory) / name).is_symlink()
)
for name in sorted(files):
path = Path(directory) / name
if safe_file(path):
yield path
def main():
OUTPUT.mkdir(exist_ok=True)
stamp = datetime.now().strftime("%Y%m%d-%H%M%S-%f")
archive = OUTPUT / f"foldershare-{stamp}.zip"
temporary = OUTPUT / f".foldershare-{stamp}.tmp"
count = 0
try:
with ZipFile(temporary, "w", compression=ZIP_DEFLATED) as zip_file:
for path in source_files():
zip_file.write(path, path.relative_to(ROOT).as_posix())
count += 1
temporary.replace(archive)
finally:
temporary.unlink(missing_ok=True)
print(f"Created {archive} ({count} files)")
if __name__ == "__main__":
main()