Skip to content

Store Secret Sync Metadata in Item Fields, Not 1Password Tags #4276

Done

Description

@ptr727

Problem

scripts/secrets_sync.py stores each item's sync metadata as 1Password tags:

  • MODE_PREFIX = "mode:" holds the file mode, for example mode:0600.
  • CONTENT_PREFIX = "mtime:" holds the content time to the microsecond, for example mtime:2026-01-02T03:04:05.123456Z.

Both are written where the plan's tags are built, from mode_tag() and content_tag().

1Password treats tags as an account-wide facet, not as per-item metadata. Every distinct tag value appears in the app's sidebar tag list, for every vault and every member of the account. Because the mtime: value is unique per item and changes on each content update, a bucket of N secrets adds about N new sidebar tags. Each content change then adds another. The mode: tags are low-cardinality, but they still show up as tags nobody uses to organize items.

The maintainer reports the tag list is now dominated by mtime: entries after the per-prefix buckets were added.

Expected

Sync metadata is stored on the item itself, where it is invisible in the tag list. A custom section on the item, for example a sync section holding mode and mtime text fields, keeps both values readable by op item get --format json and leaves tags to the user.

Done looks like

  • secrets_sync.py reads and writes mode and content time from item fields, not from tags.
  • A one-time migration moves existing mode: and mtime: tags into the fields and removes the tags. It is idempotent, so a second run writes nothing.
  • The tests in tests/test_secrets_sync.py that assert on mode: and mtime: tags are updated, and a test covers the migration path.
  • After migration, the account's tag list holds no mode: or mtime: tags.

Reported from a HomeAutomation-Config session.

🤖 Generated with Claude Code

Activity

  1. ptr727 commented on Nov 20, 2026

    @ptr727
    OwnerAuthor

    Backlog burndown question, 2026-11-19. The issue's done-when asks for a one-time migration in code that moves existing mode: and mtime: tags into item fields. That collides with the standing rule recorded in #4210: a one-off is detected and reported, and its fix is not coded. Which applies here?

    Options

    1. Detect and report, no migration code (recommended). secrets_sync.py reads and writes the metadata from item fields only. Where it finds an item still carrying a mode: or mtime: tag, it reports the item and prints the command that strips those tags, for the maintainer to run once. This follows State That a One-Off Is Detected and Reported, Never Corrected by Code #4210. The first sync after the change rewrites each item's fields from the local file, so no tag value needs carrying over.
    2. Code the idempotent migration the issue asks for, as an exception to State That a One-Off Is Detected and Reported, Never Corrected by Code #4210. One code path moves the tag values into fields and removes the tags, with a test. The tag list is cleaned with no hand step, but the code stays in the script after the one run it exists for.

    Effect on work in flight: none. No branch touches scripts/secrets_sync.py today.

  2. added
    decision
    on Nov 20, 2026
  3. ptr727 commented on Nov 20, 2026

    @ptr727
    OwnerAuthor

    Maintainer's answer, 2026-11-19 (backlog burndown). Code both halves.

    • The fix: secrets_sync.py stops writing sync metadata as tags and reads and writes it from item fields.
    • The cleanup: hundreds of existing mode: and mtime: tags are not cleared by hand, so the cleanup is coded too. It is a throwaway script, run once and then discarded. It does not stay in the repository's tooling after its one run. Running it writes to the 1Password account, so the run itself is the maintainer's to start or approve at the time.

    This is now work.

  4. removed
    decision
    on Nov 20, 2026
  5. ptr727 commented on Nov 24, 2026

    @ptr727
    OwnerAuthor

    Released (2026-11-24): PR #4427 merged to develop at 5e71f88; branch and worktree cleaned up, so this claim holds no files. The issue closes on promotion; the live cleanup run (in the PR body) is owed to the maintainer.

    Backlog burndown claim (away run 2026-11-24, round 4, refill group H): branch burndown/secrets-sync-item-fields, issue #4276.

    Predicted files:

    • scripts/secrets_sync.py, where the plan builds mode: and mtime: tags (MODE_PREFIX, CONTENT_PREFIX, mode_tag(), content_tag()), every read of them, and the selftest probes of the op tag behaviors.
    • tests/test_secrets_sync.py, the cases asserting on mode: and mtime: tags.
    • scripts/README.md, the secrets_sync.py section describing the mode and content-time tags and what selftest measures. Passed from the parked validate-task.yml Lint Steps Fail a Release on a Transient Docker Hub Error #1727 group, which has no commits ahead of origin/develop.

    Scope follows the maintainer's answer above: the fix reads and writes the metadata from item fields only, and the tag cleanup is a throwaway script that is not committed and that only the maintainer runs.

    Any other group needing one of these files waits for this branch to merge.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions