Skip to content

chore/dynamic risk docs - #6

Merged
biuworks merged 10 commits into
mainfrom
chore/dynamic-risk-docs
Aug 2, 2026
Merged

chore/dynamic risk docs#6
biuworks merged 10 commits into
mainfrom
chore/dynamic-risk-docs

Conversation

@biuworks

@biuworks biuworks commented Aug 2, 2026

Copy link
Copy Markdown
Owner
  • feat: make assess/start behavior dynamic and clarify docs onboarding
  • chore: apply remaining refactors, docs updates, and coverage tests

@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: 49548464ca

ℹ️ 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".

Comment thread src/playbook/cli.py Outdated
Comment on lines +335 to +336
"policy_profile": policy.get("project", {}).get("governance_profile", DEFAULT_GOVERNANCE_PROFILE),
"requested_level": requested_level,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Emit schema-valid Change Records

Remove these fields or add them to change.schema.json: every playbook start now writes policy_profile and requested_level, but the Change Record schema has additionalProperties: false and defines neither property. Consequently the next check, finish, or hook rejects every newly created record with PBK-E005, breaking the documented daily workflow.

Useful? React with 👍 / 👎.

Comment thread src/playbook/checker.py
Comment on lines +177 to +181
for key in bool_keys:
if key in explicit_rules:
base_rules[key] = bool(explicit_rules[key])
if "traceability_levels" in explicit_rules:
base_rules["traceability_levels"] = list(explicit_rules["traceability_levels"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Let the selected governance profile control its rules

Do not unconditionally replace profile rules with the policy's compatibility fields: policy.schema.json requires require_active_change, require_tests_for_production, and traceability_levels, so every valid policy enters these branches. For a policy produced from defaults/policy.yaml, selecting standard or strict still replaces the profile's true values and traceability levels with false/[]; therefore --profile strict and per-command --governance-profile strict silently omit the advertised Change, test, and traceability gates.

Useful? React with 👍 / 👎.

Comment thread src/playbook/checker.py
Comment on lines 474 to 475
for change_dir, record in active:
scoped_changed = [path for path in changed if matches(path, record["scope"])]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Validate only changes relevant to the current diff

Filter active records by the changed paths before performing per-change checks. With two non-overlapping active Changes, a diff scoped only to service A now also validates service B and, in merge mode, requires B to be verified; an unrelated draft T2 record can therefore fail A's check for missing traceability or status. This regresses the parallel-change isolation exercised by tests/test_parallel_changes.py.

Useful? React with 👍 / 👎.

Comment thread src/playbook/cli.py
Comment on lines +793 to +796
patch_path = _checkpoint_patch_path(root, args.checkpoint_id)
patch = patch_path.read_text(encoding="utf-8") if patch_path.is_file() else ""
if patch.strip():
_ = _git_json(["git", "apply", "--reverse", "--whitespace=nowarn", str(patch_path)], root)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Apply checkpoint patches in the restoring direction

Restore the saved snapshot rather than reverse-applying it. If checkpoint changes were later reset, this command attempts to remove changes that are no longer present and fails; if they are still present, it removes the saved state instead of reconstructing it. Thus a dirty-worktree checkpoint cannot serve as the documented recovery anchor.

Useful? React with 👍 / 👎.

Comment thread src/playbook/cli.py
Comment on lines 377 to +379
policy = yaml.safe_load(resource_path("defaults", "policy.yaml").read_text(encoding="utf-8"))
policy["project"]["minimum_level"] = args.level
policy["project"]["documentation_language"] = args.language
policy["project"]["governance_profile"] = _normalize_governance_profile(args.profile)

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 Honor the requested documentation language

Assign args.language when building the initialized policy. The default resource contains zh-CN, and this function now updates only the level and profile, so playbook init --language en-US succeeds while writing documentation_language: zh-CN; downstream agents consequently receive the opposite documentation-language policy.

Useful? React with 👍 / 👎.

Comment thread src/playbook/cli.py
Comment on lines 661 to 664
if finding.code in {"PBK-E010", "PBK-E030"}:
target = root / finding.path
if ".." in Path(finding.path).parts or not finding.path.startswith(".playbook/changes/"):
if ".." in target.parts or not target.parent.as_posix().startswith(".playbook/changes/"):
continue

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 Compare fix targets using repository-relative paths

Perform this prefix check on finding.path or a path relative to root. Since target is formed as root / finding.path, target.parent.as_posix() is absolute and never starts with .playbook/changes/; every PBK-E010 or PBK-E030 therefore takes this continue, so playbook fix no longer creates any missing required artifact.

Useful? React with 👍 / 👎.

@biuworks
biuworks merged commit cf26425 into main Aug 2, 2026
2 checks passed
@biuworks
biuworks deleted the chore/dynamic-risk-docs branch August 2, 2026 06:27
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