Skip to content

Temperance identity port + layering test harness + parallel-dispatch/GSD reference#2

Open
Sheshiyer wants to merge 9 commits into
mainfrom
temperance-identity-port
Open

Temperance identity port + layering test harness + parallel-dispatch/GSD reference#2
Sheshiyer wants to merge 9 commits into
mainfrom
temperance-identity-port

Conversation

@Sheshiyer

Copy link
Copy Markdown
Owner

What

Two threads, brainstormed → spec'd → planned → executed via subagent-driven development:

1. Identity port + layering test (this session's focus)

  • tests/sandbox-install.sh — sandbox harness that runs a real install into a throwaway HOME and asserts six groups: file landing, backups/idempotency, dry-run safety, restore-from-backup, hook behavior, GSD gating. Pins the Pulse port and never touches the real home. (18/18)
  • scripts/apply-identity.sh — surgical, dry-run-default, backup-first, idempotent, reversible (--remove) tool that prepends a <!-- temperance:identity --> block to the operator AGENTS.md surfaces while preserving all content beneath it. Path-unique backups (no basename collision). (tests/identity-tool.sh, 8/8)
  • ISA ISC-33/ISC-34 track both.

2. Parallel-dispatch / GSD reference + architecture docs (bundled prior work)

  • docs/parallel-dispatch.md decision guide; scripts/install-gsd.sh opt-in --with-gsd (detect-only, never vendors GSD); package/hooks/ParallelDispatchContext.hook.sh advisory-only session context (read-only GSD-config display, never blocks/dispatches/writes).
  • docs/architecture/{architecture,system-internals,integration-map,session-trace}.html — overview + deep-dives (mechanics, which seams are real code paths vs reference-only, a concrete session trace).

Design decisions (locked during brainstorming)

  • Live is truth — the tool attaches identity, never replaces PAI content.
  • Operator surfaces only — PAI core (~/.claude/PAI, ~/.codex/PAI symlink, CLAUDE.md, voice) untouched.
  • Single preference storeISA.md; GSD config and PAI steering/memory stay external.

Verification

  • Clean checkout of HEAD passes ./verify.sh (exit 0), sandbox harness 18/0, identity-tool 8/0.
  • Live apply already run and verified: stripping the block from each live file is byte-identical to its pre-apply backup — PAI content preserved exactly; --remove restores cleanly.
  • Final whole-branch review (opus): no Critical/Important remaining after the commit-completeness fix in this PR.

Known minor (non-blocking)

  • apply→remove appends a trailing \n to a file that lacked one. All three live targets already end in \n, so live surfaces are unaffected. Can harden the awk if we want the byte-for-byte guarantee to be literally universal.

🤖 Generated with Claude Code

Sheshiyer and others added 9 commits July 1, 2026 16:33
Approved brainstorming design for (1) a permanent sandbox install-test
harness and (2) a surgical, dry-run-default, reversible identity tool that
renames the live OpenCode/Codex operator surfaces to Temperance Engine
without altering their PAI content. Live is truth; operator surfaces only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Four tasks: sandbox install-layering harness, surgical reversible identity
tool (TDD), verify/ISA integration (ISC-33/34), and a gated live apply with
an explicit human go/no-go before any write to the live operator surfaces.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds the implementation that the already-committed verify-install.sh
check_file entries and ISA ISC-28..32 reference:
- docs/parallel-dispatch.md decision guide (superpowers dispatch vs GSD
  execute-phase/workstreams vs subagent-driven-development)
- scripts/install-gsd.sh: opt-in --with-gsd, detect-only, never vendors GSD
- package/hooks/ParallelDispatchContext.hook.sh: advisory-only session
  context, read-only GSD config display, never blocks/dispatches/writes
- install.sh: --with-gsd/--skip-gsd flag (default skip)
- docs/pai-flow.md: Execute phase references the decision guide

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- docs/architecture/architecture.html (overview: productization lineage,
  data flow, install pipeline, layers, deployment)
- system-internals.html (per-component mechanics), integration-map.html
  (which seams are real code paths vs reference-only), session-trace.html
  (concrete install-to-session walkthrough)
- README/CHANGELOG document parallel-dispatch, architecture docs, and the
  identity-port work

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a1f1333aad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# never writes into settings.json JSON structure it doesn't own):
#
# { "hooks": [ { "type": "command",
# "command": "$PAI_HOME/hooks/ParallelDispatchContext.hook.sh" } ] }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Point hook registration at an installed file

If a user follows this registration snippet after installing, the command points to $PAI_HOME/hooks/ParallelDispatchContext.hook.sh, but the installer never copies package/hooks/ParallelDispatchContext.hook.sh into $PAI_HOME/hooks (repo-wide search only finds tests invoking the repo copy). In that setup Claude will try to run a missing hook path, so either the hook needs to be installed there or the snippet should tell users to reference/copy the repo file explicitly.

Useful? React with 👍 / 👎.

Comment thread scripts/apply-identity.sh
Comment on lines +53 to +55
ib_dir="${TEMPERANCE_BACKUP_DIR:-$HOME/.temperance_engine/backups}/$ib_stamp"
mkdir -p "$ib_dir"
cp "$ib_target" "$ib_dir/$ib_slug"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make identity backups unique within a second

When apply-identity.sh is run more than once for the same target within the same second, ib_dir reuses the same timestamp directory and cp writes the same slug path, overwriting the earlier backup. This loses the original rollback point in exactly the fast re-apply/remove workflows this tool is meant to make safe; include a higher-resolution timestamp or otherwise create a unique destination before copying.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant